From 9d6a6df894cb514dc38936fa64f6ba6a5cf71b7e Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 15 May 2023 16:00:26 +0200 Subject: [PATCH 01/15] Update codesnippets (#1027) * Update README.md * checkoutpaymentmethod --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index b518e7a8c..7420a9cfa 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ API is listed in the [Supported API versions](#supported-api-versions) section o // Import the required classes import com.adyen.Client; import com.adyen.enums.Environment; -import com.adyen.service.Checkout; +import com.adyen.service.checkout.PaymentsApi; import com.adyen.model.checkout.*; // Setup Client and Service Client client = new Client("Your X-API-KEY", Environment.TEST); -Checkout checkout = new Checkout(client); +PaymentsApi paymentsApi = new PaymentsApi(client); // Create PaymentRequest PaymentRequest paymentRequest = new PaymentRequest(); @@ -82,14 +82,14 @@ CardDetails cardDetails = new CardDetails(); .encryptedSecurityCode("test_737") .encryptedExpiryMonth("test_03") .encryptedExpiryYear("test_2030"); -paymentRequest.setPaymentMethod(new PaymentDonationRequestPaymentMethod(cardDetails)); +paymentRequest.setPaymentMethod(new CheckoutPaymentMethod(cardDetails)); Amount amount = new Amount().currency("EUR").value(1000L); paymentRequest.setAmount(amount); paymentRequest.setReference("Your order number"); paymentRequest.setReturnUrl("https://your-company.com/checkout?shopperOrder=12xy.."); // Make a call to the /payments endpoint -PaymentResponse paymentResponse = checkout.payments(paymentRequest); +PaymentResponse paymentResponse = paymentsApi.payments(paymentRequest); ~~~~ @@ -99,10 +99,11 @@ For requests on live environment, you need to pass the [Live URL Prefix](https:/ // Import the required classes import com.adyen.Client; import com.adyen.enums.Environment; +import com.adyen.service.checkout.ModificationsApi // Setup Client and Service Client client = new Client("Your X-API-KEY", Environment.LIVE, "Your live URL prefix"); -Checkout checkout = new Checkout(client); +ModificationsApi modificationsApi = new ModificationsApi(client); ... ~~~~ @@ -111,10 +112,11 @@ Checkout checkout = new Checkout(client); // Import the required classes import com.adyen.Client; import com.adyen.enums.Environment; +import com.adyen.service.checkout.PaymentLinksApi // Setup Client and Service Client client = new Client("Your username", "Your password", Environment.LIVE, "Your live URL prefix", "Your application name"); -Checkout checkout = new Checkout(client); +PaymentLinksApi paymentLinksApi = new PaymentLinksApi(client); ... ~~~~ @@ -123,7 +125,7 @@ Checkout checkout = new Checkout(client); // Import the required classes import java.util.List; import com.adyen.util.HMACValidator; -import com.adyen.notification.NotificationHandler; +import com.adyen.notification.WebhookHandler; import com.adyen.model.notification.NotificationRequest; import com.adyen.model.notification.NotificationRequestItem; @@ -132,8 +134,8 @@ String hmacKey = "YOUR_HMAC_KEY"; String notificationRequestJson = "NOTIFICATION_REQUEST_JSON"; HMACValidator hmacValidator = new HMACValidator(); -NotificationHandler notificationHandler = new NotificationHandler(); -NotificationRequest notificationRequest = notificationHandler.handleNotificationJson(notificationRequestJson); +WebhookHandler webhookHandler = new WebhookHandler(); +NotificationRequest notificationRequest = webhookHandler.handleNotificationJson(notificationRequestJson); // fetch first (and only) NotificationRequestItem var notificationRequestItem = notificationRequest.getNotificationItems().stream().findFirst(); From 9820dd48598b7d50e525105058ccc844039722c5 Mon Sep 17 00:00:00 2001 From: Hari Date: Tue, 16 May 2023 17:39:20 +0530 Subject: [PATCH 02/15] Adding x-requested-verification-code in request options (#1032) * Update ApiConstants.java * Update AdyenHttpClient.java * Update RequestOptions.java --- src/main/java/com/adyen/constants/ApiConstants.java | 1 + .../java/com/adyen/httpclient/AdyenHttpClient.java | 10 ++++++++-- src/main/java/com/adyen/model/RequestOptions.java | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/adyen/constants/ApiConstants.java b/src/main/java/com/adyen/constants/ApiConstants.java index 391d00316..dea90c051 100644 --- a/src/main/java/com/adyen/constants/ApiConstants.java +++ b/src/main/java/com/adyen/constants/ApiConstants.java @@ -110,6 +110,7 @@ interface RequestProperty { String CONTENT_TYPE = "Content-Type"; String API_KEY = "x-api-key"; String APPLICATION_JSON_TYPE = "application/json"; + String REQUESTED_VERIFICATION_CODE_HEADER = "x-requested-verification-code"; } interface ThreeDS2Property { diff --git a/src/main/java/com/adyen/httpclient/AdyenHttpClient.java b/src/main/java/com/adyen/httpclient/AdyenHttpClient.java index ece66bb44..241206aac 100644 --- a/src/main/java/com/adyen/httpclient/AdyenHttpClient.java +++ b/src/main/java/com/adyen/httpclient/AdyenHttpClient.java @@ -68,6 +68,7 @@ import static com.adyen.constants.ApiConstants.RequestProperty.APPLICATION_JSON_TYPE; import static com.adyen.constants.ApiConstants.RequestProperty.CONTENT_TYPE; import static com.adyen.constants.ApiConstants.RequestProperty.IDEMPOTENCY_KEY; +import static com.adyen.constants.ApiConstants.RequestProperty.REQUESTED_VERIFICATION_CODE_HEADER; import static com.adyen.constants.ApiConstants.RequestProperty.USER_AGENT; public class AdyenHttpClient implements ClientInterface { @@ -151,8 +152,13 @@ private void setHeaders(Config config, RequestOptions requestOptions, HttpUriReq httpUriRequest.addHeader(ADYEN_LIBRARY_NAME, Client.LIB_NAME); httpUriRequest.addHeader(ADYEN_LIBRARY_VERSION, Client.LIB_VERSION); - if (requestOptions != null && requestOptions.getIdempotencyKey() != null) { - httpUriRequest.addHeader(IDEMPOTENCY_KEY, requestOptions.getIdempotencyKey()); + if (requestOptions != null) { + if (requestOptions.getIdempotencyKey() != null) { + httpUriRequest.addHeader(IDEMPOTENCY_KEY, requestOptions.getIdempotencyKey()); + } + if (requestOptions.getRequestedVerificationCodeHeader() != null) { + httpUriRequest.addHeader(REQUESTED_VERIFICATION_CODE_HEADER, requestOptions.getRequestedVerificationCodeHeader()); + } } } diff --git a/src/main/java/com/adyen/model/RequestOptions.java b/src/main/java/com/adyen/model/RequestOptions.java index 73fc4fbd8..2ed4a8e92 100644 --- a/src/main/java/com/adyen/model/RequestOptions.java +++ b/src/main/java/com/adyen/model/RequestOptions.java @@ -3,6 +3,7 @@ public class RequestOptions { private String idempotencyKey; + private String requestedVerificationCodeHeader; public String getIdempotencyKey() { return idempotencyKey; @@ -12,5 +13,12 @@ public void setIdempotencyKey(String idempotencyKey) { this.idempotencyKey = idempotencyKey; } + public String getRequestedVerificationCodeHeader() { + return requestedVerificationCodeHeader; + } + + public void setRequestedVerificationCodeHeader(String requestedVerificationCodeHeader) { + this.requestedVerificationCodeHeader = requestedVerificationCodeHeader; + } } From 18fd21b2f947707c33c01f95cdc74cea6e7f921b Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Mon, 22 May 2023 15:59:11 +0200 Subject: [PATCH 03/15] Remove hard validation for additional and optional fields (#1030) * make models for release * Add Capital API (ITT-549) * bump versions and polish readme * Update README.md * log warning instead of exceptions for validation * replace exceptions with warning logs and ignore in oneOf * make models * Update Makefile Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> * Update templates/libraries/okhttp-gson/pojo.mustache Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> * fix models * removed logging of entire response (security/compliance issue) * remove log warning in UT --------- Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> --- Makefile | 6 +- .../adyen/model/balancecontrol/Amount.java | 10 +- .../BalanceTransferRequest.java | 16 +- .../BalanceTransferResponse.java | 18 +- .../AULocalAccountIdentification.java | 12 +- .../model/balanceplatform/AccountHolder.java | 22 +- .../AccountHolderCapability.java | 10 +- .../balanceplatform/AccountHolderInfo.java | 18 +- .../AccountSupportingEntityCapability.java | 10 +- .../ActiveNetworkTokensRestriction.java | 10 +- .../AdditionalBankIdentification.java | 10 +- .../adyen/model/balanceplatform/Address.java | 20 +- .../adyen/model/balanceplatform/Amount.java | 10 +- .../model/balanceplatform/Authentication.java | 12 +- .../adyen/model/balanceplatform/Balance.java | 10 +- .../model/balanceplatform/BalanceAccount.java | 20 +- .../balanceplatform/BalanceAccountBase.java | 20 +- .../balanceplatform/BalanceAccountInfo.java | 18 +- .../BalanceAccountUpdateRequest.java | 18 +- .../balanceplatform/BalancePlatform.java | 14 +- .../BalanceSweepConfigurationsResponse.java | 8 +- ...ccountIdentificationValidationRequest.java | 8 +- ...alidationRequestAccountIdentification.java | 12 + .../BrandVariantsRestriction.java | 12 +- .../model/balanceplatform/BulkAddress.java | 26 +- .../CALocalAccountIdentification.java | 14 +- .../CZLocalAccountIdentification.java | 12 +- .../model/balanceplatform/CapitalBalance.java | 10 +- .../balanceplatform/CapitalGrantAccount.java | 12 +- .../com/adyen/model/balanceplatform/Card.java | 22 +- .../balanceplatform/CardConfiguration.java | 34 +- .../adyen/model/balanceplatform/CardInfo.java | 14 +- .../model/balanceplatform/ContactDetails.java | 12 +- .../balanceplatform/CountriesRestriction.java | 12 +- .../balanceplatform/CronSweepSchedule.java | 10 +- .../balanceplatform/DayOfWeekRestriction.java | 12 +- .../balanceplatform/DeliveryAddress.java | 22 +- .../balanceplatform/DeliveryContact.java | 14 +- .../DifferentCurrenciesRestriction.java | 10 +- .../adyen/model/balanceplatform/Duration.java | 8 +- .../EntryModesRestriction.java | 12 +- .../adyen/model/balanceplatform/Expiry.java | 12 +- .../com/adyen/model/balanceplatform/Fee.java | 8 +- .../model/balanceplatform/GrantLimit.java | 8 +- .../model/balanceplatform/GrantOffer.java | 12 +- .../model/balanceplatform/GrantOffers.java | 8 +- .../HULocalAccountIdentification.java | 10 +- .../IbanAccountIdentification.java | 10 +- .../InternationalTransactionRestriction.java | 10 +- .../model/balanceplatform/InvalidField.java | 14 +- .../model/balanceplatform/JSONObject.java | 8 +- .../adyen/model/balanceplatform/JSONPath.java | 10 +- .../MatchingTransactionsRestriction.java | 10 +- .../balanceplatform/MccsRestriction.java | 12 +- .../balanceplatform/MerchantAcquirerPair.java | 12 +- .../MerchantNamesRestriction.java | 10 +- .../balanceplatform/MerchantsRestriction.java | 10 +- .../NOLocalAccountIdentification.java | 10 +- .../com/adyen/model/balanceplatform/Name.java | 12 +- .../NumberAndBicAccountIdentification.java | 12 +- .../PLLocalAccountIdentification.java | 10 +- .../PaginatedAccountHoldersResponse.java | 8 +- .../PaginatedBalanceAccountsResponse.java | 8 +- .../PaginatedPaymentInstrumentsResponse.java | 8 +- .../balanceplatform/PaymentInstrument.java | 20 +- .../PaymentInstrumentBankAccount.java | 2 + .../PaymentInstrumentGroup.java | 18 +- .../PaymentInstrumentGroupInfo.java | 16 +- .../PaymentInstrumentInfo.java | 18 +- .../PaymentInstrumentRevealInfo.java | 12 +- .../PaymentInstrumentUpdateRequest.java | 12 +- .../adyen/model/balanceplatform/Phone.java | 10 +- .../model/balanceplatform/PhoneNumber.java | 12 +- .../ProcessingTypesRestriction.java | 12 +- .../model/balanceplatform/Repayment.java | 8 +- .../model/balanceplatform/RepaymentTerm.java | 8 +- .../balanceplatform/RestServiceError.java | 20 +- .../SELocalAccountIdentification.java | 12 +- .../SGLocalAccountIdentification.java | 12 +- .../model/balanceplatform/StringMatch.java | 10 +- .../balanceplatform/SweepConfigurationV2.java | 16 +- .../SweepConfigurationV2Schedule.java | 2 + .../balanceplatform/SweepCounterparty.java | 14 +- .../model/balanceplatform/SweepSchedule.java | 8 +- .../balanceplatform/ThresholdRepayment.java | 8 +- .../model/balanceplatform/TimeOfDay.java | 12 +- .../balanceplatform/TimeOfDayRestriction.java | 10 +- .../TotalAmountRestriction.java | 10 +- .../balanceplatform/TransactionRule.java | 20 +- .../TransactionRuleEntityKey.java | 12 +- .../balanceplatform/TransactionRuleInfo.java | 18 +- .../TransactionRuleInterval.java | 12 +- .../TransactionRuleResponse.java | 8 +- .../TransactionRuleRestrictions.java | 8 +- .../TransactionRulesResponse.java | 8 +- .../UKLocalAccountIdentification.java | 12 +- .../USLocalAccountIdentification.java | 12 +- .../UpdatePaymentInstrument.java | 22 +- .../balanceplatform/VerificationDeadline.java | 10 +- .../com/adyen/model/binlookup/Amount.java | 10 +- .../com/adyen/model/binlookup/BinDetail.java | 10 +- .../com/adyen/model/binlookup/CardBin.java | 28 +- .../binlookup/CostEstimateAssumptions.java | 8 +- .../model/binlookup/CostEstimateRequest.java | 18 +- .../model/binlookup/CostEstimateResponse.java | 14 +- .../model/binlookup/DSPublicKeyDetail.java | 14 +- .../model/binlookup/MerchantDetails.java | 12 +- .../com/adyen/model/binlookup/Recurring.java | 12 +- .../adyen/model/binlookup/ServiceError.java | 16 +- .../binlookup/ThreeDS2CardRangeDetail.java | 20 +- .../binlookup/ThreeDSAvailabilityRequest.java | 18 +- .../ThreeDSAvailabilityResponse.java | 8 +- .../java/com/adyen/model/capital/Amount.java | 10 +- .../adyen/model/capital/CapitalBalance.java | 10 +- .../com/adyen/model/capital/CapitalGrant.java | 14 +- .../adyen/model/capital/CapitalGrantInfo.java | 12 +- .../adyen/model/capital/CapitalGrants.java | 8 +- .../com/adyen/model/capital/Counterparty.java | 14 +- .../java/com/adyen/model/capital/Fee.java | 8 +- .../com/adyen/model/capital/InvalidField.java | 14 +- .../com/adyen/model/capital/JSONObject.java | 8 +- .../com/adyen/model/capital/JSONPath.java | 10 +- .../com/adyen/model/capital/Repayment.java | 8 +- .../adyen/model/capital/RepaymentTerm.java | 8 +- .../adyen/model/capital/RestServiceError.java | 20 +- .../model/capital/ThresholdRepayment.java | 8 +- .../com/adyen/model/checkout/AccountInfo.java | 14 +- .../com/adyen/model/checkout/AcctInfo.java | 26 +- .../com/adyen/model/checkout/AchDetails.java | 24 +- .../checkout/AdditionalData3DSecure.java | 18 +- .../model/checkout/AdditionalDataAirline.java | 64 ++-- .../checkout/AdditionalDataCarRental.java | 54 ++-- .../model/checkout/AdditionalDataCommon.java | 38 ++- .../model/checkout/AdditionalDataLevel23.java | 42 +-- .../model/checkout/AdditionalDataLodging.java | 40 ++- .../checkout/AdditionalDataOpenInvoice.java | 44 +-- .../model/checkout/AdditionalDataOpi.java | 10 +- .../model/checkout/AdditionalDataRatepay.java | 24 +- .../model/checkout/AdditionalDataRetry.java | 14 +- .../model/checkout/AdditionalDataRisk.java | 50 +-- .../AdditionalDataRiskStandalone.java | 38 ++- .../checkout/AdditionalDataSubMerchant.java | 28 +- .../AdditionalDataTemporaryServices.java | 26 +- .../model/checkout/AdditionalDataWallets.java | 20 +- .../com/adyen/model/checkout/Address.java | 20 +- .../adyen/model/checkout/AfterpayDetails.java | 20 +- .../model/checkout/AmazonPayDetails.java | 12 +- .../java/com/adyen/model/checkout/Amount.java | 10 +- .../model/checkout/AndroidPayDetails.java | 10 +- .../adyen/model/checkout/ApplePayDetails.java | 16 +- .../checkout/ApplePaySessionResponse.java | 10 +- .../adyen/model/checkout/ApplicationInfo.java | 8 +- .../model/checkout/AuthenticationData.java | 8 +- .../java/com/adyen/model/checkout/Avs.java | 8 +- .../checkout/BacsDirectDebitDetails.java | 20 +- .../com/adyen/model/checkout/BankAccount.java | 26 +- .../adyen/model/checkout/BillDeskDetails.java | 12 +- .../com/adyen/model/checkout/BlikDetails.java | 16 +- .../com/adyen/model/checkout/BrowserInfo.java | 14 +- .../java/com/adyen/model/checkout/Card.java | 24 +- .../model/checkout/CardBrandDetails.java | 10 +- .../com/adyen/model/checkout/CardDetails.java | 48 +-- .../model/checkout/CardDetailsRequest.java | 18 +- .../model/checkout/CardDetailsResponse.java | 8 +- .../model/checkout/CellulantDetails.java | 12 +- .../model/checkout/CheckoutAwaitAction.java | 14 +- .../checkout/CheckoutBalanceCheckRequest.java | 44 +-- .../CheckoutBalanceCheckResponse.java | 12 +- .../checkout/CheckoutCancelOrderRequest.java | 10 +- .../checkout/CheckoutCancelOrderResponse.java | 10 +- .../checkout/CheckoutCreateOrderRequest.java | 14 +- .../checkout/CheckoutCreateOrderResponse.java | 18 +- .../CheckoutNativeRedirectAction.java | 16 +- .../model/checkout/CheckoutOrderResponse.java | 16 +- .../model/checkout/CheckoutPaymentMethod.java | 39 +++ .../model/checkout/CheckoutQrCodeAction.java | 18 +- .../checkout/CheckoutRedirectAction.java | 14 +- .../model/checkout/CheckoutSDKAction.java | 14 +- .../CheckoutSessionInstallmentOption.java | 12 +- .../checkout/CheckoutThreeDS2Action.java | 20 +- .../checkout/CheckoutUtilityRequest.java | 10 +- .../checkout/CheckoutUtilityResponse.java | 8 +- .../model/checkout/CheckoutVoucherAction.java | 40 ++- .../com/adyen/model/checkout/CommonField.java | 12 +- .../com/adyen/model/checkout/Company.java | 20 +- .../CreateApplePaySessionRequest.java | 14 +- .../CreateCheckoutSessionRequest.java | 52 ++-- .../CreateCheckoutSessionResponse.java | 56 ++-- .../CreatePaymentAmountUpdateRequest.java | 12 +- .../checkout/CreatePaymentCancelRequest.java | 12 +- .../checkout/CreatePaymentCaptureRequest.java | 12 +- .../checkout/CreatePaymentLinkRequest.java | 50 +-- .../checkout/CreatePaymentRefundRequest.java | 12 +- .../CreatePaymentReversalRequest.java | 12 +- .../CreateStandalonePaymentCancelRequest.java | 14 +- .../adyen/model/checkout/DetailsRequest.java | 10 +- .../DetailsRequestAuthenticationData.java | 8 +- .../model/checkout/DeviceRenderOptions.java | 10 +- .../com/adyen/model/checkout/DokuDetails.java | 16 +- .../model/checkout/DonationResponse.java | 16 +- .../adyen/model/checkout/DotpayDetails.java | 12 +- .../model/checkout/DragonpayDetails.java | 14 +- .../checkout/EcontextVoucherDetails.java | 18 +- .../model/checkout/EncryptedOrderData.java | 12 +- .../model/checkout/ExternalPlatform.java | 14 +- .../com/adyen/model/checkout/ForexQuote.java | 20 +- .../model/checkout/FraudCheckResult.java | 10 +- .../com/adyen/model/checkout/FraudResult.java | 8 +- .../com/adyen/model/checkout/FundOrigin.java | 8 +- .../adyen/model/checkout/FundRecipient.java | 20 +- .../GenericIssuerPaymentMethodDetails.java | 16 +- .../adyen/model/checkout/GiropayDetails.java | 14 +- .../model/checkout/GooglePayDetails.java | 16 +- .../adyen/model/checkout/IdealDetails.java | 16 +- .../com/adyen/model/checkout/InputDetail.java | 16 +- .../model/checkout/InstallmentOption.java | 12 +- .../adyen/model/checkout/Installments.java | 8 +- .../model/checkout/InstallmentsNumber.java | 8 +- .../java/com/adyen/model/checkout/Item.java | 12 +- .../adyen/model/checkout/KlarnaDetails.java | 20 +- .../com/adyen/model/checkout/LineItem.java | 32 +- .../ListStoredPaymentMethodsResponse.java | 12 +- .../com/adyen/model/checkout/Mandate.java | 18 +- .../model/checkout/MasterpassDetails.java | 12 +- .../adyen/model/checkout/MbwayDetails.java | 14 +- .../adyen/model/checkout/MerchantDevice.java | 14 +- .../model/checkout/MerchantRiskIndicator.java | 20 +- .../model/checkout/MobilePayDetails.java | 10 +- .../model/checkout/ModelConfiguration.java | 8 +- .../adyen/model/checkout/MolPayDetails.java | 12 +- .../java/com/adyen/model/checkout/Name.java | 12 +- .../model/checkout/OpenInvoiceDetails.java | 20 +- .../adyen/model/checkout/PayPalDetails.java | 18 +- .../adyen/model/checkout/PayUUpiDetails.java | 18 +- .../model/checkout/PayWithGoogleDetails.java | 16 +- .../checkout/PaymentAmountUpdateResource.java | 16 +- .../model/checkout/PaymentCancelResource.java | 16 +- .../checkout/PaymentCaptureResource.java | 16 +- .../checkout/PaymentCompletionDetails.java | 42 +-- .../adyen/model/checkout/PaymentDetails.java | 12 +- .../checkout/PaymentDetailsResponse.java | 22 +- .../checkout/PaymentDonationRequest.java | 62 ++-- .../model/checkout/PaymentLinkResponse.java | 54 ++-- .../adyen/model/checkout/PaymentMethod.java | 16 +- .../model/checkout/PaymentMethodGroup.java | 14 +- .../model/checkout/PaymentMethodIssuer.java | 12 +- .../model/checkout/PaymentMethodsRequest.java | 22 +- .../checkout/PaymentMethodsResponse.java | 8 +- .../model/checkout/PaymentRefundResource.java | 16 +- .../adyen/model/checkout/PaymentRequest.java | 56 ++-- .../adyen/model/checkout/PaymentResponse.java | 20 +- .../model/checkout/PaymentResponseAction.java | 7 + .../checkout/PaymentReversalResource.java | 16 +- .../model/checkout/PaymentSetupRequest.java | 58 ++-- .../model/checkout/PaymentSetupResponse.java | 10 +- .../checkout/PaymentVerificationRequest.java | 10 +- .../checkout/PaymentVerificationResponse.java | 18 +- .../java/com/adyen/model/checkout/Phone.java | 12 +- .../checkout/PlatformChargebackLogic.java | 12 +- .../adyen/model/checkout/RatepayDetails.java | 20 +- .../com/adyen/model/checkout/Recurring.java | 12 +- .../adyen/model/checkout/RecurringDetail.java | 18 +- .../ResponseAdditionalData3DSecure.java | 16 +- .../ResponseAdditionalDataBillingAddress.java | 20 +- .../checkout/ResponseAdditionalDataCard.java | 24 +- .../ResponseAdditionalDataCommon.java | 122 ++++---- .../ResponseAdditionalDataInstallments.java | 32 +- .../ResponseAdditionalDataNetworkTokens.java | 14 +- .../checkout/ResponseAdditionalDataOpi.java | 10 +- .../checkout/ResponseAdditionalDataSepa.java | 14 +- .../model/checkout/ResponsePaymentMethod.java | 12 +- .../com/adyen/model/checkout/RiskData.java | 12 +- .../adyen/model/checkout/SDKEphemPubKey.java | 16 +- .../model/checkout/SamsungPayDetails.java | 16 +- .../checkout/SepaDirectDebitDetails.java | 18 +- .../adyen/model/checkout/ServiceError.java | 16 +- .../adyen/model/checkout/ServiceError2.java | 16 +- .../adyen/model/checkout/ShopperInput.java | 8 +- .../checkout/ShopperInteractionDevice.java | 14 +- .../java/com/adyen/model/checkout/Split.java | 26 +- .../com/adyen/model/checkout/SplitAmount.java | 10 +- .../StandalonePaymentCancelResource.java | 16 +- .../adyen/model/checkout/StoredDetails.java | 10 +- .../model/checkout/StoredPaymentMethod.java | 36 ++- .../checkout/StoredPaymentMethodDetails.java | 14 +- .../checkout/StoredPaymentMethodResource.java | 42 +-- .../adyen/model/checkout/SubInputDetail.java | 14 +- .../com/adyen/model/checkout/SubMerchant.java | 18 +- .../model/checkout/ThreeDS2RequestData.java | 52 ++-- .../model/checkout/ThreeDS2ResponseData.java | 46 +-- .../adyen/model/checkout/ThreeDS2Result.java | 30 +- .../model/checkout/ThreeDSRequestData.java | 8 +- .../ThreeDSRequestorAuthenticationInfo.java | 12 +- ...reeDSRequestorPriorAuthenticationInfo.java | 14 +- .../model/checkout/ThreeDSecureData.java | 20 +- .../checkout/UpdatePaymentLinkRequest.java | 8 +- .../model/checkout/UpiCollectDetails.java | 20 +- .../model/checkout/UpiIntentDetails.java | 16 +- .../adyen/model/checkout/VippsDetails.java | 16 +- .../model/checkout/VisaCheckoutDetails.java | 12 +- .../model/checkout/WeChatPayDetails.java | 10 +- .../checkout/WeChatPayMiniProgramDetails.java | 14 +- .../com/adyen/model/checkout/ZipDetails.java | 16 +- .../model/dataprotection/ServiceError.java | 16 +- .../SubjectErasureByPspReferenceRequest.java | 12 +- .../SubjectErasureResponse.java | 8 +- .../AULocalAccountIdentification.java | 12 +- .../AcceptTermsOfServiceRequest.java | 12 +- .../AcceptTermsOfServiceResponse.java | 18 +- .../AdditionalBankIdentification.java | 10 +- .../model/legalentitymanagement/Address.java | 20 +- .../model/legalentitymanagement/Amount.java | 10 +- .../legalentitymanagement/Attachment.java | 16 +- .../BankAccountInfo.java | 44 ++- .../BankAccountInfoAccountIdentification.java | 12 + .../legalentitymanagement/BirthData.java | 10 +- .../legalentitymanagement/BusinessLine.java | 18 +- .../BusinessLineInfo.java | 16 +- .../BusinessLineInfoUpdate.java | 16 +- .../legalentitymanagement/BusinessLines.java | 8 +- .../CALocalAccountIdentification.java | 14 +- .../CZLocalAccountIdentification.java | 12 +- .../CapabilityProblem.java | 8 +- .../CapabilityProblemEntity.java | 12 +- .../CapabilityProblemEntityRecursive.java | 12 +- .../CapabilitySettings.java | 10 +- .../DKLocalAccountIdentification.java | 12 +- .../model/legalentitymanagement/Document.java | 22 +- .../DocumentReference.java | 16 +- .../EntityReference.java | 10 +- .../GeneratePciDescriptionRequest.java | 10 +- .../GeneratePciDescriptionResponse.java | 12 +- .../GetPciQuestionnaireInfosResponse.java | 8 +- .../GetPciQuestionnaireResponse.java | 10 +- ...TermsOfServiceAcceptanceInfosResponse.java | 8 +- .../GetTermsOfServiceDocumentRequest.java | 10 +- .../GetTermsOfServiceDocumentResponse.java | 14 +- .../HULocalAccountIdentification.java | 10 +- .../IbanAccountIdentification.java | 10 +- .../IdentificationData.java | 18 +- .../legalentitymanagement/Individual.java | 12 +- .../legalentitymanagement/LegalEntity.java | 12 +- .../LegalEntityAssociation.java | 18 +- .../LegalEntityCapability.java | 10 +- .../LegalEntityInfo.java | 10 +- .../LegalEntityInfoRequiredType.java | 10 +- .../NOLocalAccountIdentification.java | 10 +- .../model/legalentitymanagement/Name.java | 14 +- .../NumberAndBicAccountIdentification.java | 12 +- .../legalentitymanagement/OnboardingLink.java | 10 +- .../OnboardingLinkInfo.java | 14 +- .../OnboardingTheme.java | 12 +- .../OnboardingThemes.java | 12 +- .../legalentitymanagement/Organization.java | 22 +- .../legalentitymanagement/OwnerEntity.java | 12 +- .../PLLocalAccountIdentification.java | 10 +- .../PciDocumentInfo.java | 10 +- .../PciSigningRequest.java | 12 +- .../PciSigningResponse.java | 12 +- .../legalentitymanagement/PhoneNumber.java | 12 +- .../RemediatingAction.java | 12 +- .../SELocalAccountIdentification.java | 12 +- .../legalentitymanagement/ServiceError.java | 16 +- .../SoleProprietorship.java | 20 +- .../legalentitymanagement/SourceOfFunds.java | 12 +- .../legalentitymanagement/StockData.java | 14 +- .../SupportingEntityCapability.java | 12 +- .../legalentitymanagement/TaxInformation.java | 14 +- .../TaxReportingClassification.java | 10 +- .../TermsOfServiceAcceptanceInfo.java | 14 +- .../TransferInstrument.java | 12 +- .../TransferInstrumentInfo.java | 10 +- .../TransferInstrumentReference.java | 18 +- .../UKLocalAccountIdentification.java | 12 +- .../USLocalAccountIdentification.java | 12 +- .../VerificationError.java | 14 +- .../VerificationErrorRecursive.java | 14 +- .../VerificationErrors.java | 8 +- .../model/legalentitymanagement/WebData.java | 12 +- .../WebDataExemption.java | 8 +- .../model/management/AdditionalSettings.java | 10 +- .../AdditionalSettingsResponse.java | 12 +- .../com/adyen/model/management/Address.java | 22 +- .../model/management/AfterpayTouchInfo.java | 222 +++++++++++++ .../adyen/model/management/AllowedOrigin.java | 12 +- .../management/AllowedOriginsResponse.java | 8 +- .../com/adyen/model/management/Amount.java | 10 +- .../adyen/model/management/AndroidApp.java | 20 +- .../model/management/AndroidAppsResponse.java | 8 +- .../model/management/AndroidCertificate.java | 18 +- .../AndroidCertificatesResponse.java | 8 +- .../adyen/model/management/ApiCredential.java | 20 +- .../model/management/ApiCredentialLinks.java | 8 +- .../adyen/model/management/ApplePayInfo.java | 10 +- .../com/adyen/model/management/BcmcInfo.java | 8 +- .../management/BillingEntitiesResponse.java | 8 +- .../adyen/model/management/BillingEntity.java | 16 +- .../model/management/CardholderReceipt.java | 10 +- .../model/management/CartesBancairesInfo.java | 10 +- .../adyen/model/management/ClearpayInfo.java | 222 +++++++++++++ .../com/adyen/model/management/Company.java | 18 +- .../management/CompanyApiCredential.java | 22 +- .../adyen/model/management/CompanyLinks.java | 8 +- .../adyen/model/management/CompanyUser.java | 96 +++--- .../adyen/model/management/Connectivity.java | 8 +- .../com/adyen/model/management/Contact.java | 18 +- .../CreateAllowedOriginRequest.java | 12 +- .../CreateApiCredentialResponse.java | 24 +- .../CreateCompanyApiCredentialRequest.java | 16 +- .../CreateCompanyApiCredentialResponse.java | 26 +- .../management/CreateCompanyUserRequest.java | 67 +--- .../management/CreateCompanyUserResponse.java | 96 +++--- .../CreateCompanyWebhookRequest.java | 20 +- .../CreateMerchantApiCredentialRequest.java | 14 +- .../management/CreateMerchantRequest.java | 22 +- .../management/CreateMerchantResponse.java | 22 +- .../management/CreateMerchantUserRequest.java | 65 +--- .../CreateMerchantWebhookRequest.java | 18 +- .../model/management/CreateUserResponse.java | 64 ++-- .../com/adyen/model/management/Currency.java | 10 +- .../model/management/CustomNotification.java | 16 +- .../adyen/model/management/DataCenter.java | 12 +- .../com/adyen/model/management/EventUrl.java | 8 +- .../management/ExternalTerminalAction.java | 20 +- .../management/GenerateApiKeyResponse.java | 10 +- .../management/GenerateClientKeyResponse.java | 10 +- .../management/GenerateHmacKeyResponse.java | 10 +- .../adyen/model/management/GiroPayInfo.java | 10 +- .../adyen/model/management/GooglePayInfo.java | 10 +- .../com/adyen/model/management/Gratuity.java | 12 +- .../com/adyen/model/management/Hardware.java | 8 +- .../com/adyen/model/management/IdName.java | 12 +- .../management/InstallAndroidAppDetails.java | 10 +- .../InstallAndroidCertificateDetails.java | 10 +- .../adyen/model/management/InvalidField.java | 14 +- .../model/management/InvalidFieldWrapper.java | 215 +++++++++++++ .../java/com/adyen/model/management/JSON.java | 7 +- .../adyen/model/management/JSONObject.java | 21 +- .../com/adyen/model/management/JSONPath.java | 10 +- .../model/management/JSONPathWrapper.java | 215 +++++++++++++ .../java/com/adyen/model/management/Key.java | 12 +- .../adyen/model/management/KlarnaInfo.java | 12 +- .../com/adyen/model/management/Links.java | 8 +- .../adyen/model/management/LinksElement.java | 10 +- .../ListCompanyApiCredentialsResponse.java | 8 +- .../model/management/ListCompanyResponse.java | 8 +- .../management/ListCompanyUsersResponse.java | 8 +- .../ListExternalTerminalActionsResponse.java | 8 +- .../ListMerchantApiCredentialsResponse.java | 8 +- .../management/ListMerchantResponse.java | 8 +- .../management/ListMerchantUsersResponse.java | 8 +- .../model/management/ListStoresResponse.java | 8 +- .../management/ListTerminalsResponse.java | 113 ++++++- .../management/ListWebhooksResponse.java | 10 +- .../java/com/adyen/model/management/Logo.java | 10 +- .../model/management/MeApiCredential.java | 24 +- .../model/management/MealVoucherFRInfo.java | 14 +- .../com/adyen/model/management/Merchant.java | 32 +- .../adyen/model/management/MerchantLinks.java | 8 +- .../management/MinorUnitsMonetaryValue.java | 10 +- .../model/management/ModelConfiguration.java | 12 +- .../com/adyen/model/management/ModelFile.java | 12 +- .../java/com/adyen/model/management/Name.java | 12 +- .../com/adyen/model/management/Name2.java | 12 +- .../java/com/adyen/model/management/Nexo.java | 10 +- .../model/management/NotificationUrl.java | 8 +- .../model/management/OfflineProcessing.java | 8 +- .../java/com/adyen/model/management/Opi.java | 12 +- .../com/adyen/model/management/OrderItem.java | 12 +- .../model/management/PaginationLinks.java | 8 +- .../com/adyen/model/management/Passcodes.java | 16 +- .../adyen/model/management/PayAtTable.java | 8 +- .../adyen/model/management/PayPalInfo.java | 12 +- .../com/adyen/model/management/Payment.java | 10 +- .../adyen/model/management/PaymentMethod.java | 132 +++++++- .../management/PaymentMethodResponse.java | 28 +- .../management/PaymentMethodSetupInfo.java | 130 +++++++- .../management/PaymentMethodWrapper.java | 215 +++++++++++++ .../model/management/PayoutSettings.java | 14 +- .../management/PayoutSettingsRequest.java | 12 +- .../management/PayoutSettingsResponse.java | 8 +- .../com/adyen/model/management/Profile.java | 28 +- .../model/management/ReceiptOptions.java | 12 +- .../model/management/ReceiptPrinting.java | 8 +- .../management/ReleaseUpdateDetails.java | 8 +- .../management/RequestActivationResponse.java | 12 +- .../model/management/RestServiceError.java | 34 +- .../ScheduleTerminalActionsRequest.java | 14 +- ...leTerminalActionsRequestActionDetails.java | 5 + .../ScheduleTerminalActionsResponse.java | 14 +- .../com/adyen/model/management/Settings.java | 10 +- .../model/management/ShippingLocation.java | 12 +- .../management/ShippingLocationsResponse.java | 8 +- .../model/management/ShopperStatement.java | 293 ------------------ .../com/adyen/model/management/Signature.java | 12 +- .../adyen/model/management/SofortInfo.java | 12 +- .../adyen/model/management/Standalone.java | 10 +- .../com/adyen/model/management/Store.java | 24 +- .../management/StoreCreationRequest.java | 28 +- .../StoreCreationWithMerchantCodeRequest.java | 30 +- .../adyen/model/management/StoreLocation.java | 22 +- .../management/StoreSplitConfiguration.java | 12 +- .../com/adyen/model/management/Surcharge.java | 8 +- .../com/adyen/model/management/SwishInfo.java | 10 +- .../com/adyen/model/management/Terminal.java | 136 ++++++-- .../TerminalActionScheduleDetail.java | 12 +- .../management/TerminalModelsResponse.java | 8 +- .../adyen/model/management/TerminalOrder.java | 18 +- .../management/TerminalOrderRequest.java | 51 ++- .../management/TerminalOrdersResponse.java | 8 +- .../model/management/TerminalProduct.java | 16 +- .../management/TerminalProductPrice.java | 10 +- .../management/TerminalProductsResponse.java | 8 +- .../model/management/TerminalSettings.java | 8 +- .../management/TestCompanyWebhookRequest.java | 12 +- .../adyen/model/management/TestOutput.java | 20 +- .../model/management/TestWebhookRequest.java | 10 +- .../model/management/TestWebhookResponse.java | 8 +- .../com/adyen/model/management/Timeouts.java | 8 +- .../com/adyen/model/management/TwintInfo.java | 222 +++++++++++++ .../UninstallAndroidAppDetails.java | 10 +- .../UninstallAndroidCertificateDetails.java | 10 +- .../model/management/UpdatableAddress.java | 20 +- .../UpdateCompanyApiCredentialRequest.java | 16 +- .../management/UpdateCompanyUserRequest.java | 102 +----- .../UpdateCompanyWebhookRequest.java | 18 +- .../UpdateMerchantApiCredentialRequest.java | 14 +- .../management/UpdateMerchantUserRequest.java | 100 +----- .../UpdateMerchantWebhookRequest.java | 16 +- .../management/UpdatePaymentMethodInfo.java | 161 +++++----- .../UpdatePayoutSettingsRequest.java | 8 +- .../model/management/UpdateStoreRequest.java | 14 +- .../java/com/adyen/model/management/Url.java | 14 +- .../java/com/adyen/model/management/User.java | 64 ++-- .../com/adyen/model/management/VippsInfo.java | 16 +- .../com/adyen/model/management/Webhook.java | 26 +- .../adyen/model/management/WebhookLinks.java | 8 +- .../adyen/model/management/WifiProfiles.java | 8 +- .../com/adyen/model/payment/AccountInfo.java | 14 +- .../com/adyen/model/payment/AcctInfo.java | 26 +- .../model/payment/AdditionalData3DSecure.java | 18 +- .../model/payment/AdditionalDataAirline.java | 176 ++++++----- .../payment/AdditionalDataCarRental.java | 146 ++++----- .../model/payment/AdditionalDataCommon.java | 38 ++- .../model/payment/AdditionalDataLevel23.java | 110 +++---- .../model/payment/AdditionalDataLodging.java | 131 ++++---- .../payment/AdditionalDataModifications.java | 10 +- .../payment/AdditionalDataOpenInvoice.java | 44 +-- .../model/payment/AdditionalDataOpi.java | 10 +- .../model/payment/AdditionalDataRatepay.java | 24 +- .../model/payment/AdditionalDataRetry.java | 14 +- .../model/payment/AdditionalDataRisk.java | 50 +-- .../payment/AdditionalDataRiskStandalone.java | 38 ++- .../payment/AdditionalDataSubMerchant.java | 28 +- .../AdditionalDataTemporaryServices.java | 62 ++-- .../model/payment/AdditionalDataWallets.java | 20 +- .../java/com/adyen/model/payment/Address.java | 20 +- .../payment/AdjustAuthorisationRequest.java | 20 +- .../java/com/adyen/model/payment/Amount.java | 10 +- .../adyen/model/payment/ApplicationInfo.java | 8 +- .../payment/AuthenticationResultRequest.java | 12 +- .../payment/AuthenticationResultResponse.java | 8 +- .../com/adyen/model/payment/BankAccount.java | 26 +- .../com/adyen/model/payment/BrowserInfo.java | 14 +- .../model/payment/CancelOrRefundRequest.java | 20 +- .../adyen/model/payment/CancelRequest.java | 20 +- .../adyen/model/payment/CaptureRequest.java | 20 +- .../java/com/adyen/model/payment/Card.java | 24 +- .../com/adyen/model/payment/CommonField.java | 12 +- .../model/payment/DeviceRenderOptions.java | 10 +- .../adyen/model/payment/DonationRequest.java | 16 +- .../adyen/model/payment/ExternalPlatform.java | 14 +- .../com/adyen/model/payment/ForexQuote.java | 20 +- .../adyen/model/payment/FraudCheckResult.java | 10 +- .../payment/FraudCheckResultWrapper.java | 8 +- .../com/adyen/model/payment/FraudResult.java | 8 +- .../adyen/model/payment/FundDestination.java | 16 +- .../com/adyen/model/payment/FundSource.java | 12 +- .../com/adyen/model/payment/Installments.java | 8 +- .../java/com/adyen/model/payment/Mandate.java | 18 +- .../adyen/model/payment/MerchantDevice.java | 14 +- .../model/payment/MerchantRiskIndicator.java | 20 +- .../model/payment/ModificationResult.java | 10 +- .../java/com/adyen/model/payment/Name.java | 12 +- .../adyen/model/payment/PaymentRequest.java | 46 +-- .../adyen/model/payment/PaymentRequest3d.java | 48 +-- .../model/payment/PaymentRequest3ds2.java | 46 +-- .../adyen/model/payment/PaymentResult.java | 22 +- .../java/com/adyen/model/payment/Phone.java | 12 +- .../payment/PlatformChargebackLogic.java | 12 +- .../com/adyen/model/payment/Recurring.java | 12 +- .../adyen/model/payment/RefundRequest.java | 20 +- .../ResponseAdditionalData3DSecure.java | 16 +- .../ResponseAdditionalDataBillingAddress.java | 20 +- .../payment/ResponseAdditionalDataCard.java | 24 +- .../payment/ResponseAdditionalDataCommon.java | 122 ++++---- .../ResponseAdditionalDataInstallments.java | 32 +- .../ResponseAdditionalDataNetworkTokens.java | 14 +- .../payment/ResponseAdditionalDataOpi.java | 10 +- .../payment/ResponseAdditionalDataSepa.java | 14 +- .../adyen/model/payment/SDKEphemPubKey.java | 16 +- .../com/adyen/model/payment/ServiceError.java | 16 +- .../payment/ShopperInteractionDevice.java | 14 +- .../java/com/adyen/model/payment/Split.java | 26 +- .../com/adyen/model/payment/SplitAmount.java | 10 +- .../com/adyen/model/payment/SubMerchant.java | 18 +- .../model/payment/TechnicalCancelRequest.java | 18 +- .../adyen/model/payment/ThreeDS1Result.java | 20 +- .../model/payment/ThreeDS2RequestData.java | 52 ++-- .../adyen/model/payment/ThreeDS2Result.java | 30 +- .../model/payment/ThreeDS2ResultRequest.java | 12 +- .../model/payment/ThreeDS2ResultResponse.java | 8 +- .../ThreeDSRequestorAuthenticationInfo.java | 12 +- ...reeDSRequestorPriorAuthenticationInfo.java | 14 +- .../adyen/model/payment/ThreeDSecureData.java | 20 +- .../payment/VoidPendingRefundRequest.java | 20 +- .../java/com/adyen/model/payout/Address.java | 20 +- .../java/com/adyen/model/payout/Amount.java | 10 +- .../com/adyen/model/payout/BankAccount.java | 26 +- .../java/com/adyen/model/payout/Card.java | 24 +- .../adyen/model/payout/FraudCheckResult.java | 10 +- .../model/payout/FraudCheckResultWrapper.java | 8 +- .../com/adyen/model/payout/FraudResult.java | 8 +- .../com/adyen/model/payout/FundSource.java | 12 +- .../com/adyen/model/payout/ModifyRequest.java | 12 +- .../adyen/model/payout/ModifyResponse.java | 12 +- .../java/com/adyen/model/payout/Name.java | 12 +- .../com/adyen/model/payout/PayoutRequest.java | 20 +- .../adyen/model/payout/PayoutResponse.java | 22 +- .../com/adyen/model/payout/Recurring.java | 12 +- .../ResponseAdditionalData3DSecure.java | 16 +- .../ResponseAdditionalDataBillingAddress.java | 20 +- .../payout/ResponseAdditionalDataCard.java | 24 +- .../payout/ResponseAdditionalDataCommon.java | 122 ++++---- .../ResponseAdditionalDataInstallments.java | 32 +- .../ResponseAdditionalDataNetworkTokens.java | 14 +- .../payout/ResponseAdditionalDataOpi.java | 10 +- .../payout/ResponseAdditionalDataSepa.java | 14 +- .../com/adyen/model/payout/ServiceError.java | 16 +- .../payout/StoreDetailAndSubmitRequest.java | 26 +- .../payout/StoreDetailAndSubmitResponse.java | 14 +- .../model/payout/StoreDetailRequest.java | 22 +- .../model/payout/StoreDetailResponse.java | 14 +- .../com/adyen/model/payout/SubmitRequest.java | 24 +- .../adyen/model/payout/SubmitResponse.java | 14 +- .../model/posterminalmanagement/Address.java | 20 +- .../AssignTerminalsRequest.java | 16 +- .../AssignTerminalsResponse.java | 8 +- .../FindTerminalRequest.java | 10 +- .../FindTerminalResponse.java | 16 +- .../GetStoresUnderAccountRequest.java | 12 +- .../GetStoresUnderAccountResponse.java | 8 +- .../GetTerminalDetailsRequest.java | 10 +- .../GetTerminalDetailsResponse.java | 46 +-- .../GetTerminalsUnderAccountRequest.java | 14 +- .../GetTerminalsUnderAccountResponse.java | 12 +- .../MerchantAccount.java | 14 +- .../posterminalmanagement/ServiceError.java | 16 +- .../model/posterminalmanagement/Store.java | 18 +- .../com/adyen/model/recurring/Address.java | 20 +- .../com/adyen/model/recurring/Amount.java | 10 +- .../adyen/model/recurring/BankAccount.java | 26 +- .../java/com/adyen/model/recurring/Card.java | 24 +- .../model/recurring/CreatePermitRequest.java | 14 +- .../model/recurring/CreatePermitResult.java | 10 +- .../model/recurring/DisablePermitRequest.java | 12 +- .../model/recurring/DisablePermitResult.java | 12 +- .../adyen/model/recurring/DisableRequest.java | 16 +- .../adyen/model/recurring/DisableResult.java | 10 +- .../java/com/adyen/model/recurring/Name.java | 12 +- .../model/recurring/NotifyShopperRequest.java | 24 +- .../model/recurring/NotifyShopperResult.java | 22 +- .../com/adyen/model/recurring/Permit.java | 14 +- .../model/recurring/PermitRestriction.java | 8 +- .../adyen/model/recurring/PermitResult.java | 12 +- .../com/adyen/model/recurring/Recurring.java | 12 +- .../model/recurring/RecurringDetail.java | 28 +- .../recurring/RecurringDetailWrapper.java | 8 +- .../recurring/RecurringDetailsRequest.java | 12 +- .../recurring/RecurringDetailsResult.java | 12 +- .../ScheduleAccountUpdaterRequest.java | 16 +- .../ScheduleAccountUpdaterResult.java | 12 +- .../adyen/model/recurring/ServiceError.java | 16 +- .../adyen/model/recurring/TokenDetails.java | 10 +- .../com/adyen/model/storedvalue/Amount.java | 10 +- .../adyen/model/storedvalue/ServiceError.java | 16 +- .../StoredValueBalanceCheckRequest.java | 18 +- .../StoredValueBalanceCheckResponse.java | 14 +- .../StoredValueBalanceMergeRequest.java | 18 +- .../StoredValueBalanceMergeResponse.java | 16 +- .../storedvalue/StoredValueIssueRequest.java | 18 +- .../storedvalue/StoredValueIssueResponse.java | 16 +- .../storedvalue/StoredValueLoadRequest.java | 18 +- .../storedvalue/StoredValueLoadResponse.java | 16 +- .../StoredValueStatusChangeRequest.java | 18 +- .../StoredValueStatusChangeResponse.java | 16 +- .../storedvalue/StoredValueVoidRequest.java | 20 +- .../storedvalue/StoredValueVoidResponse.java | 14 +- .../AULocalAccountIdentification.java | 12 +- .../AdditionalBankIdentification.java | 10 +- .../com/adyen/model/transfers/Address2.java | 20 +- .../com/adyen/model/transfers/Amount.java | 10 +- .../BRLocalAccountIdentification.java | 14 +- .../adyen/model/transfers/BankAccountV3.java | 8 +- .../BankAccountV3AccountIdentification.java | 14 + .../CALocalAccountIdentification.java | 14 +- .../CZLocalAccountIdentification.java | 12 +- .../model/transfers/CounterpartyInfoV3.java | 12 +- .../adyen/model/transfers/CounterpartyV3.java | 12 +- .../DKLocalAccountIdentification.java | 12 +- .../HULocalAccountIdentification.java | 10 +- .../transfers/IbanAccountIdentification.java | 10 +- .../adyen/model/transfers/InvalidField.java | 14 +- .../com/adyen/model/transfers/JSONObject.java | 8 +- .../com/adyen/model/transfers/JSONPath.java | 10 +- .../java/com/adyen/model/transfers/Link.java | 10 +- .../java/com/adyen/model/transfers/Links.java | 8 +- .../adyen/model/transfers/MerchantData.java | 14 +- .../NOLocalAccountIdentification.java | 10 +- .../adyen/model/transfers/NameLocation.java | 20 +- .../NumberAndBicAccountIdentification.java | 12 +- .../PLLocalAccountIdentification.java | 10 +- .../model/transfers/PartyIdentification2.java | 16 +- .../model/transfers/PaymentInstrument.java | 16 +- .../model/transfers/ResourceReference.java | 14 +- .../model/transfers/RestServiceError.java | 20 +- .../SELocalAccountIdentification.java | 12 +- .../SGLocalAccountIdentification.java | 12 +- .../adyen/model/transfers/Transaction.java | 26 +- .../transfers/TransactionSearchResponse.java | 8 +- .../com/adyen/model/transfers/Transfer.java | 24 +- .../adyen/model/transfers/TransferInfo.java | 24 +- .../UKLocalAccountIdentification.java | 12 +- .../USLocalAccountIdentification.java | 12 +- .../UltimatePartyIdentification.java | 16 +- .../com/adyen/service/BalanceControlApi.java | 2 +- .../com/adyen/LegalEntityManagementTest.java | 43 ++- .../okhttp-gson/oneof_model.mustache | 1 + templates/libraries/okhttp-gson/pojo.mustache | 12 +- 739 files changed, 10326 insertions(+), 4669 deletions(-) create mode 100644 src/main/java/com/adyen/model/management/AfterpayTouchInfo.java create mode 100644 src/main/java/com/adyen/model/management/ClearpayInfo.java create mode 100644 src/main/java/com/adyen/model/management/InvalidFieldWrapper.java create mode 100644 src/main/java/com/adyen/model/management/JSONPathWrapper.java create mode 100644 src/main/java/com/adyen/model/management/PaymentMethodWrapper.java delete mode 100644 src/main/java/com/adyen/model/management/ShopperStatement.java create mode 100644 src/main/java/com/adyen/model/management/TwintInfo.java diff --git a/Makefile b/Makefile index 1fa5296a0..23417ce6d 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 payment payout recurring transfers +modelGen:=balancecontrol balanceplatform binlookup capital checkout dataprotection legalentitymanagement management payment payout posterminalmanagement recurring transfers storedvalue models:=src/main/java/com/adyen/model output:=target/out @@ -41,7 +41,7 @@ marketpay/configuration: spec=NotificationConfigurationService-v6 marketpay/webhooks: spec=MarketPayNotificationService-v6 hop: spec=HopService-v6 -$(services): target/spec $(openapi-generator-jar) +$(modelGen): target/spec $(openapi-generator-jar) rm -rf $(models)/$@ $(output) $(openapi-generator-cli) generate \ -i target/spec/json/$(spec).json \ @@ -64,7 +64,7 @@ $(services): target/spec $(openapi-generator-jar) mv $(output)/$(models)/JSON.java $(models)/$@ # Full service + models automation -bigServices:=balanceplatform checkout storedValue payout management legalentitymanagement transfers +bigServices:=balanceplatform checkout payout management legalentitymanagement transfers singleFileServices:=balancecontrol binlookup dataprotection storedvalue posterminalmanagement recurring payment capital services: $(bigServices) $(singleFileServices) diff --git a/src/main/java/com/adyen/model/balancecontrol/Amount.java b/src/main/java/com/adyen/model/balancecontrol/Amount.java index db7b2578f..ca5bf3aa6 100644 --- a/src/main/java/com/adyen/model/balancecontrol/Amount.java +++ b/src/main/java/com/adyen/model/balancecontrol/Amount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balancecontrol.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java index a5bab2f59..d7eb6318a 100644 --- a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balancecontrol.JSON; @@ -333,6 +335,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("toMerchant"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceTransferRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -353,7 +359,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceTransferRequest` properties.", entry.getKey())); } } @@ -369,19 +375,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java index 16e09421f..4e51901fe 100644 --- a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balancecontrol.JSON; @@ -475,6 +477,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("toMerchant"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceTransferResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -495,7 +501,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceTransferResponse` properties.", entry.getKey())); } } @@ -511,19 +517,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -534,7 +540,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java index e5f9fdf06..d1b1e7797 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bsbCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AULocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AULocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index 1863e9dbb..451ca001a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -47,6 +47,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -477,6 +479,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("legalEntityId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolder.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -497,7 +503,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AccountHolder.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountHolder` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolder` properties.", entry.getKey())); } } @@ -509,7 +515,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field balancePlatform if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); } // validate the optional field `contactDetails` if (jsonObj.getAsJsonObject("contactDetails") != null) { @@ -517,23 +523,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } // validate the optional field primaryBalanceAccount if (jsonObj.get("primaryBalanceAccount") != null && !jsonObj.get("primaryBalanceAccount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `primaryBalanceAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryBalanceAccount").toString())); + log.log(Level.WARNING, String.format("Expected the field `primaryBalanceAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryBalanceAccount").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())); + log.log(Level.WARNING, 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) { @@ -544,7 +550,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java index 0f6543ff6..04182dd5c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -531,6 +533,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolderCapability.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -551,7 +557,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AccountHolderCapability.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountHolderCapability` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolderCapability` properties.", entry.getKey())); } } // ensure the field allowedLevel can be parsed to an enum value @@ -567,7 +573,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("problems") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").toString())); } // ensure the field requestedLevel can be parsed to an enum value if (jsonObj.get("requestedLevel") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index 560fa8da5..4e2f37581 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -315,6 +317,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("legalEntityId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolderInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -335,7 +341,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AccountHolderInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountHolderInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolderInfo` properties.", entry.getKey())); } } @@ -347,7 +353,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field balancePlatform if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); } // validate the optional field `contactDetails` if (jsonObj.getAsJsonObject("contactDetails") != null) { @@ -355,19 +361,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java index 7de73d709..bb8505583 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -432,6 +434,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountSupportingEntityCapability.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -452,7 +458,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountSupportingEntityCapability` properties.", entry.getKey())); } } // ensure the field allowedLevel can be parsed to an enum value @@ -464,7 +470,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the field requestedLevel can be parsed to an enum value if (jsonObj.get("requestedLevel") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java index b92f8eff8..80a70c320 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ActiveNetworkTokensRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ActiveNetworkTokensRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ActiveNetworkTokensRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ActiveNetworkTokensRestriction` properties.", entry.getKey())); } } @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java index d817ed804..a74ffd204 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalBankIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,12 +229,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalBankIdentification` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/Address.java b/src/main/java/com/adyen/model/balanceplatform/Address.java index 2d36db409..d7359f6ed 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Address.java +++ b/src/main/java/com/adyen/model/balanceplatform/Address.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -277,6 +279,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("postalCode"); openapiRequiredFields.add("street"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -297,7 +303,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } @@ -309,27 +315,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 houseNumberOrName if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Amount.java b/src/main/java/com/adyen/model/balanceplatform/Amount.java index 2e49858fb..c028e469a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Amount.java +++ b/src/main/java/com/adyen/model/balanceplatform/Amount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Authentication.java b/src/main/java/com/adyen/model/balanceplatform/Authentication.java index 78e8d34f5..708bc40ed 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Authentication.java +++ b/src/main/java/com/adyen/model/balanceplatform/Authentication.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Authentication.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,16 +212,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Authentication.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Authentication` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Authentication` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // validate the optional field `phone` if (jsonObj.getAsJsonObject("phone") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/Balance.java b/src/main/java/com/adyen/model/balanceplatform/Balance.java index 0f59bc096..979fca7a1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -218,6 +220,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("reserved"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Balance.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -238,7 +244,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Balance.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Balance` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Balance` properties.", entry.getKey())); } } @@ -250,7 +256,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index 7a4b545a3..fa9b5bc76 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -394,6 +396,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountHolderId"); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -414,7 +420,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BalanceAccount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceAccount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccount` properties.", entry.getKey())); } } @@ -426,7 +432,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } JsonArray jsonArraybalances = jsonObj.getAsJsonArray("balances"); if (jsonArraybalances != null) { @@ -442,19 +448,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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) { @@ -465,7 +471,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java index 372adf4ec..31cf0dbaa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -354,6 +356,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountHolderId"); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccountBase.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -374,7 +380,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountBase` properties.", entry.getKey())); } } @@ -386,23 +392,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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) { @@ -413,7 +419,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index bbe282b21..09bb60b64 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("accountHolderId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccountInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,7 +270,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BalanceAccountInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountInfo` properties.", entry.getKey())); } } @@ -276,23 +282,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index d861c3cf2..4fd8a0310 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -323,6 +325,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccountUpdateRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -343,24 +349,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BalanceAccountUpdateRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountUpdateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountUpdateRequest` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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) { @@ -371,7 +377,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java index 7f5ec4607..1129e0a22 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalancePlatform.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,7 +212,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BalancePlatform.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalancePlatform` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalancePlatform` properties.", entry.getKey())); } } @@ -218,15 +224,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java index 318e48a5e..76835e907 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -196,6 +198,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("hasPrevious"); openapiRequiredFields.add("sweeps"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceSweepConfigurationsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -216,7 +222,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BalanceSweepConfigurationsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BalanceSweepConfigurationsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceSweepConfigurationsResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java index aa9de9837..07e71356f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("accountIdentification"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccountIdentificationValidationRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccountIdentificationValidationRequest` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java index c4535ff64..716293c3b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java @@ -694,6 +694,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with AULocalAccountIdentification try { + Logger.getLogger(AULocalAccountIdentification.class.getName()).setLevel(Level.OFF); AULocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -702,6 +703,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CALocalAccountIdentification try { + Logger.getLogger(CALocalAccountIdentification.class.getName()).setLevel(Level.OFF); CALocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -710,6 +712,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CZLocalAccountIdentification try { + Logger.getLogger(CZLocalAccountIdentification.class.getName()).setLevel(Level.OFF); CZLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -718,6 +721,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with HULocalAccountIdentification try { + Logger.getLogger(HULocalAccountIdentification.class.getName()).setLevel(Level.OFF); HULocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -726,6 +730,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with IbanAccountIdentification try { + Logger.getLogger(IbanAccountIdentification.class.getName()).setLevel(Level.OFF); IbanAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -734,6 +739,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with NOLocalAccountIdentification try { + Logger.getLogger(NOLocalAccountIdentification.class.getName()).setLevel(Level.OFF); NOLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -742,6 +748,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with NumberAndBicAccountIdentification try { + Logger.getLogger(NumberAndBicAccountIdentification.class.getName()).setLevel(Level.OFF); NumberAndBicAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -750,6 +757,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PLLocalAccountIdentification try { + Logger.getLogger(PLLocalAccountIdentification.class.getName()).setLevel(Level.OFF); PLLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -758,6 +766,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SELocalAccountIdentification try { + Logger.getLogger(SELocalAccountIdentification.class.getName()).setLevel(Level.OFF); SELocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -766,6 +775,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SGLocalAccountIdentification try { + Logger.getLogger(SGLocalAccountIdentification.class.getName()).setLevel(Level.OFF); SGLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -774,6 +784,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UKLocalAccountIdentification try { + Logger.getLogger(UKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); UKLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -782,6 +793,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with USLocalAccountIdentification try { + Logger.getLogger(USLocalAccountIdentification.class.getName()).setLevel(Level.OFF); USLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java index ab5c16b49..15fbb66fe 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BrandVariantsRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BrandVariantsRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BrandVariantsRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BrandVariantsRestriction` properties.", entry.getKey())); } } @@ -199,11 +205,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java index 590966926..753042b71 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -360,6 +362,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("country"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BulkAddress.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -380,7 +386,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BulkAddress.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BulkAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BulkAddress` properties.", entry.getKey())); } } @@ -392,39 +398,39 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 company if (jsonObj.get("company") != null && !jsonObj.get("company").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString())); + log.log(Level.WARNING, String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field houseNumberOrName if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); } // validate the optional field mobile if (jsonObj.get("mobile") != null && !jsonObj.get("mobile").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mobile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile").toString())); + log.log(Level.WARNING, String.format("Expected the field `mobile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java index 29b7d8e76..8f8ce3f11 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -339,6 +341,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("transitNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CALocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -359,7 +365,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CALocalAccountIdentification` properties.", entry.getKey())); } } @@ -371,7 +377,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -382,11 +388,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java index c8c28d5c3..816fb73ba 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bankCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CZLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CZLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java index 469daec01..b1cf641f0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -218,6 +220,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("principal"); openapiRequiredFields.add("total"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapitalBalance.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -238,7 +244,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalBalance` properties.", entry.getKey())); } } @@ -250,7 +256,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java index 4cce53442..ce4d4e1f6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -234,6 +236,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapitalGrantAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -254,7 +260,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrantAccount` properties.", entry.getKey())); } } JsonArray jsonArraybalances = jsonObj.getAsJsonArray("balances"); @@ -271,11 +277,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } JsonArray jsonArraylimits = jsonObj.getAsJsonArray("limits"); if (jsonArraylimits != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/Card.java b/src/main/java/com/adyen/model/balanceplatform/Card.java index 452e72c66..7845098d7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Card.java +++ b/src/main/java/com/adyen/model/balanceplatform/Card.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -503,6 +505,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("formFactor"); openapiRequiredFields.add("number"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Card.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -523,7 +529,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Card.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Card` properties.", entry.getKey())); } } @@ -539,19 +545,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field bin if (jsonObj.get("bin") != null && !jsonObj.get("bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field brandVariant if (jsonObj.get("brandVariant") != null && !jsonObj.get("brandVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brandVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `brandVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandVariant").toString())); } // validate the optional field cardholderName if (jsonObj.get("cardholderName") != null && !jsonObj.get("cardholderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardholderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardholderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardholderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardholderName").toString())); } // validate the optional field `configuration` if (jsonObj.getAsJsonObject("configuration") != null) { @@ -559,7 +565,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `deliveryContact` if (jsonObj.getAsJsonObject("deliveryContact") != null) { @@ -578,11 +584,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field lastFour if (jsonObj.get("lastFour") != null && !jsonObj.get("lastFour").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").toString())); + log.log(Level.WARNING, String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java index bc058aaea..ceb6a31f2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -506,6 +508,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("configurationProfileId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardConfiguration.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -526,7 +532,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardConfiguration.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardConfiguration` properties.", entry.getKey())); } } @@ -538,11 +544,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field activation if (jsonObj.get("activation") != null && !jsonObj.get("activation").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `activation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activation").toString())); + log.log(Level.WARNING, String.format("Expected the field `activation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activation").toString())); } // validate the optional field activationUrl if (jsonObj.get("activationUrl") != null && !jsonObj.get("activationUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `activationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activationUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `activationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activationUrl").toString())); } // validate the optional field `bulkAddress` if (jsonObj.getAsJsonObject("bulkAddress") != null) { @@ -550,47 +556,47 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cardImageId if (jsonObj.get("cardImageId") != null && !jsonObj.get("cardImageId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardImageId").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardImageId").toString())); } // validate the optional field carrier if (jsonObj.get("carrier") != null && !jsonObj.get("carrier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carrier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrier").toString())); + log.log(Level.WARNING, String.format("Expected the field `carrier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrier").toString())); } // validate the optional field carrierImageId if (jsonObj.get("carrierImageId") != null && !jsonObj.get("carrierImageId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carrierImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrierImageId").toString())); + log.log(Level.WARNING, String.format("Expected the field `carrierImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrierImageId").toString())); } // validate the optional field configurationProfileId if (jsonObj.get("configurationProfileId") != null && !jsonObj.get("configurationProfileId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `configurationProfileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configurationProfileId").toString())); + log.log(Level.WARNING, String.format("Expected the field `configurationProfileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configurationProfileId").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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } // validate the optional field envelope if (jsonObj.get("envelope") != null && !jsonObj.get("envelope").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `envelope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("envelope").toString())); + log.log(Level.WARNING, String.format("Expected the field `envelope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("envelope").toString())); } // validate the optional field insert if (jsonObj.get("insert") != null && !jsonObj.get("insert").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `insert` to be a primitive type in the JSON string but got `%s`", jsonObj.get("insert").toString())); + log.log(Level.WARNING, String.format("Expected the field `insert` to be a primitive type in the JSON string but got `%s`", jsonObj.get("insert").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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } // validate the optional field logoImageId if (jsonObj.get("logoImageId") != null && !jsonObj.get("logoImageId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `logoImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoImageId").toString())); + log.log(Level.WARNING, String.format("Expected the field `logoImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoImageId").toString())); } // validate the optional field pinMailer if (jsonObj.get("pinMailer") != null && !jsonObj.get("pinMailer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pinMailer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pinMailer").toString())); + log.log(Level.WARNING, String.format("Expected the field `pinMailer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pinMailer").toString())); } // validate the optional field shipmentMethod if (jsonObj.get("shipmentMethod") != null && !jsonObj.get("shipmentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shipmentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipmentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `shipmentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipmentMethod").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java index 6d139ab2a..c653b07d7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -357,6 +359,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("cardholderName"); openapiRequiredFields.add("formFactor"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -377,7 +383,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardInfo` properties.", entry.getKey())); } } @@ -393,15 +399,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field brandVariant if (jsonObj.get("brandVariant") != null && !jsonObj.get("brandVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brandVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `brandVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandVariant").toString())); } // validate the optional field cardholderName if (jsonObj.get("cardholderName") != null && !jsonObj.get("cardholderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardholderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardholderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardholderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardholderName").toString())); } // validate the optional field `configuration` if (jsonObj.getAsJsonObject("configuration") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java index 15339fb0e..8a8a67757 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java +++ b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -219,6 +221,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("email"); openapiRequiredFields.add("phone"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ContactDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -239,7 +245,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ContactDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ContactDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ContactDetails` properties.", entry.getKey())); } } @@ -255,7 +261,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field `phone` if (jsonObj.getAsJsonObject("phone") != null) { @@ -263,7 +269,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field webAddress if (jsonObj.get("webAddress") != null && !jsonObj.get("webAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java index e98dc9222..3dc872281 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CountriesRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CountriesRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CountriesRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CountriesRestriction` properties.", entry.getKey())); } } @@ -199,11 +205,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java index b0481491d..8e9815ec0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -210,6 +212,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("cronExpression"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CronSweepSchedule.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -230,7 +236,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CronSweepSchedule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CronSweepSchedule` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CronSweepSchedule` properties.", entry.getKey())); } } @@ -242,7 +248,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cronExpression if (jsonObj.get("cronExpression") != null && !jsonObj.get("cronExpression").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cronExpression` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cronExpression").toString())); + log.log(Level.WARNING, String.format("Expected the field `cronExpression` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cronExpression").toString())); } // 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/balanceplatform/DayOfWeekRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java index facb055c1..04343a7f9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -224,6 +226,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DayOfWeekRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -244,7 +250,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DayOfWeekRestriction` properties.", entry.getKey())); } } @@ -256,11 +262,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java index 1194f1bba..cc2353508 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -302,6 +304,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("country"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DeliveryAddress.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -322,7 +328,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DeliveryAddress` properties.", entry.getKey())); } } @@ -334,31 +340,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 line1 if (jsonObj.get("line1") != null && !jsonObj.get("line1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); + log.log(Level.WARNING, String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); } // validate the optional field line2 if (jsonObj.get("line2") != null && !jsonObj.get("line2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); + log.log(Level.WARNING, String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); } // validate the optional field line3 if (jsonObj.get("line3") != null && !jsonObj.get("line3").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line3").toString())); + log.log(Level.WARNING, String.format("Expected the field `line3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line3").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateOrProvince").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java index ea55d0296..620e6455c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -277,6 +279,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("address"); openapiRequiredFields.add("name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DeliveryContact.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -297,7 +303,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DeliveryContact.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeliveryContact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DeliveryContact` properties.", entry.getKey())); } } @@ -313,11 +319,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field fullPhoneNumber if (jsonObj.get("fullPhoneNumber") != null && !jsonObj.get("fullPhoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fullPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullPhoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `fullPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullPhoneNumber").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -329,7 +335,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field webAddress if (jsonObj.get("webAddress") != null && !jsonObj.get("webAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java index d8fd8d90f..3e093b041 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DifferentCurrenciesRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DifferentCurrenciesRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DifferentCurrenciesRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DifferentCurrenciesRestriction` properties.", entry.getKey())); } } @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Duration.java b/src/main/java/com/adyen/model/balanceplatform/Duration.java index cf7212158..5969667e8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Duration.java +++ b/src/main/java/com/adyen/model/balanceplatform/Duration.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -209,6 +211,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Duration.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -229,7 +235,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Duration.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Duration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Duration` properties.", entry.getKey())); } } // ensure the field unit can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java index 73649d98b..5e3763216 100644 --- a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(EntryModesRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!EntryModesRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EntryModesRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `EntryModesRestriction` properties.", entry.getKey())); } } @@ -260,11 +266,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Expiry.java b/src/main/java/com/adyen/model/balanceplatform/Expiry.java index 87cfed533..30f5a0642 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Expiry.java +++ b/src/main/java/com/adyen/model/balanceplatform/Expiry.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Expiry.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Expiry.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Expiry` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Expiry` properties.", entry.getKey())); } } // validate the optional field month if (jsonObj.get("month") != null && !jsonObj.get("month").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `month` to be a primitive type in the JSON string but got `%s`", jsonObj.get("month").toString())); + log.log(Level.WARNING, String.format("Expected the field `month` to be a primitive type in the JSON string but got `%s`", jsonObj.get("month").toString())); } // validate the optional field year if (jsonObj.get("year") != null && !jsonObj.get("year").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("year").toString())); + log.log(Level.WARNING, String.format("Expected the field `year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("year").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Fee.java b/src/main/java/com/adyen/model/balanceplatform/Fee.java index a4707e663..efbe94300 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Fee.java +++ b/src/main/java/com/adyen/model/balanceplatform/Fee.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("amount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Fee.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Fee` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java index f9db1458f..21bd5e00e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GrantLimit.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GrantLimit` properties.", entry.getKey())); } } // validate the optional field `amount` diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java index 34553cf57..8418ad7c6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -381,6 +383,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("accountHolderId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GrantOffer.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -401,7 +407,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GrantOffer` properties.", entry.getKey())); } } @@ -413,7 +419,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -432,7 +438,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `repayment` if (jsonObj.getAsJsonObject("repayment") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java index a2ad92430..9a9b3c28c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -136,6 +138,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("grantOffers"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GrantOffers.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -156,7 +162,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GrantOffers` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java index b49471c82..b1f7ba32e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(HULocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `HULocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java index fbe78d5b5..062d01ab1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("iban"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IbanAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java index 5a694b49e..31787cc24 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InternationalTransactionRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!InternationalTransactionRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InternationalTransactionRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InternationalTransactionRestriction` properties.", entry.getKey())); } } @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java index 9faadc39f..bb7c4065a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java +++ b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InvalidField.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InvalidField` properties.", entry.getKey())); } } @@ -220,15 +226,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field name if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field value if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/JSONObject.java b/src/main/java/com/adyen/model/balanceplatform/JSONObject.java index 89c912411..3269370d7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSONObject.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSONObject.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONObject.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties.", entry.getKey())); } } JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); diff --git a/src/main/java/com/adyen/model/balanceplatform/JSONPath.java b/src/main/java/com/adyen/model/balanceplatform/JSONPath.java index 4ee2b2bc4..3dfb698fa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSONPath.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSONPath.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONPath.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,12 +163,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); + log.log(Level.WARNING, String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java index 960fe16a5..013b1bd39 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MatchingTransactionsRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MatchingTransactionsRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MatchingTransactionsRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MatchingTransactionsRestriction` properties.", entry.getKey())); } } @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java index 5eff4168c..73eadf424 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MccsRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MccsRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MccsRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MccsRestriction` properties.", entry.getKey())); } } @@ -199,11 +205,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java index 837012693..feb8b25a7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantAcquirerPair.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantAcquirerPair.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantAcquirerPair` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantAcquirerPair` properties.", entry.getKey())); } } // validate the optional field acquirerId if (jsonObj.get("acquirerId") != null && !jsonObj.get("acquirerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerId").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerId").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())); + log.log(Level.WARNING, 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/balanceplatform/MerchantNamesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java index 601e63477..7ebfd0234 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantNamesRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantNamesRestriction` properties.", entry.getKey())); } } @@ -200,7 +206,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java index 4a90412d9..43bb9f494 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantsRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantsRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantsRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantsRestriction` properties.", entry.getKey())); } } @@ -200,7 +206,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java index b8073b94a..26256e443 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NOLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NOLocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/Name.java b/src/main/java/com/adyen/model/balanceplatform/Name.java index f38b6be5a..1600aa802 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Name.java +++ b/src/main/java/com/adyen/model/balanceplatform/Name.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java index 03d328275..8655ae64c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -263,6 +265,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bic"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NumberAndBicAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -283,7 +289,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NumberAndBicAccountIdentification` properties.", entry.getKey())); } } @@ -295,7 +301,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -303,7 +309,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java index 941b2cb60..ee382435e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PLLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PLLocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java index 6b4dcce10..64b52e373 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -196,6 +198,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("hasNext"); openapiRequiredFields.add("hasPrevious"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaginatedAccountHoldersResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -216,7 +222,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaginatedAccountHoldersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginatedAccountHoldersResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaginatedAccountHoldersResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java index d8c97a1d1..5da67add6 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -196,6 +198,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("hasNext"); openapiRequiredFields.add("hasPrevious"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaginatedBalanceAccountsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -216,7 +222,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaginatedBalanceAccountsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginatedBalanceAccountsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaginatedBalanceAccountsResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java index b79a5586b..fc3f5eac2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -196,6 +198,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("hasPrevious"); openapiRequiredFields.add("paymentInstruments"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaginatedPaymentInstrumentsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -216,7 +222,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaginatedPaymentInstrumentsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginatedPaymentInstrumentsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaginatedPaymentInstrumentsResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java index 4ad745a50..805775310 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -580,6 +582,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuingCountryCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrument.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -600,7 +606,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrument` properties.", entry.getKey())); } } @@ -612,7 +618,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field `bankAccount` if (jsonObj.getAsJsonObject("bankAccount") != null) { @@ -624,23 +630,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java index b73c62419..419c3fe49 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java @@ -243,6 +243,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with IbanAccountIdentification try { + Logger.getLogger(IbanAccountIdentification.class.getName()).setLevel(Level.OFF); IbanAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -251,6 +252,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with USLocalAccountIdentification try { + Logger.getLogger(USLocalAccountIdentification.class.getName()).setLevel(Level.OFF); USLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java index 3e5140995..314a73ff8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -285,6 +287,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("balancePlatform"); openapiRequiredFields.add("txVariant"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentGroup.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -305,7 +311,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentInstrumentGroup.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentGroup` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentGroup` properties.", entry.getKey())); } } @@ -317,23 +323,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field balancePlatform if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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 txVariant if (jsonObj.get("txVariant") != null && !jsonObj.get("txVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `txVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txVariant").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java index 7491d773b..c447a9a84 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -256,6 +258,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("balancePlatform"); openapiRequiredFields.add("txVariant"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentGroupInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -276,7 +282,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentInstrumentGroupInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentGroupInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentGroupInfo` properties.", entry.getKey())); } } @@ -288,19 +294,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field balancePlatform if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 txVariant if (jsonObj.get("txVariant") != null && !jsonObj.get("txVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `txVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txVariant").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java index 0a23d105b..db2185884 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -520,6 +522,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuingCountryCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -540,7 +546,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentInstrumentInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentInfo` properties.", entry.getKey())); } } @@ -552,7 +558,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field `card` if (jsonObj.getAsJsonObject("card") != null) { @@ -560,19 +566,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java index 367d95a38..e661bee0c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -189,6 +191,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("expiration"); openapiRequiredFields.add("pan"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentRevealInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -209,7 +215,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentRevealInfo` properties.", entry.getKey())); } } @@ -221,7 +227,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -229,7 +235,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `pan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pan").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java index dc084ee12..4778cf7d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -354,6 +356,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentUpdateRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -374,12 +380,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentInstrumentUpdateRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentUpdateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentUpdateRequest` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field `card` if (jsonObj.getAsJsonObject("card") != null) { @@ -394,7 +400,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/Phone.java b/src/main/java/com/adyen/model/balanceplatform/Phone.java index 1b210ff19..944184778 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Phone.java +++ b/src/main/java/com/adyen/model/balanceplatform/Phone.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -205,6 +207,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("number"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Phone.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -225,7 +231,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Phone.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Phone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Phone` properties.", entry.getKey())); } } @@ -237,7 +243,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // 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/balanceplatform/PhoneNumber.java b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java index a4bcdc025..eb001e57d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java +++ b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -236,6 +238,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PhoneNumber.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -256,16 +262,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PhoneNumber.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PhoneNumber` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `phoneCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountryCode").toString())); } // validate the optional field phoneNumber if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); } // ensure the field phoneType can be parsed to an enum value if (jsonObj.get("phoneType") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java index a4a8cc5c6..50f7a9da1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -226,6 +228,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ProcessingTypesRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -246,7 +252,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ProcessingTypesRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ProcessingTypesRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ProcessingTypesRestriction` properties.", entry.getKey())); } } @@ -258,11 +264,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be an array in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/Repayment.java b/src/main/java/com/adyen/model/balanceplatform/Repayment.java index 01df3f3e6..6c93ad851 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Repayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/Repayment.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("basisPoints"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Repayment.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Repayment` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java index 7faac34d6..bd6cfc5e0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("estimatedDays"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RepaymentTerm.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RepaymentTerm` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java index 911a41d6b..92e29c7df 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java +++ b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -376,6 +378,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("title"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RestServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -396,7 +402,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RestServiceError` properties.", entry.getKey())); } } @@ -408,15 +414,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); } // validate the optional field errorCode if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field instance if (jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); } JsonArray jsonArrayinvalidFields = jsonObj.getAsJsonArray("invalidFields"); if (jsonArrayinvalidFields != null) { @@ -432,7 +438,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); } // validate the optional field `response` if (jsonObj.getAsJsonObject("response") != null) { @@ -440,11 +446,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } // validate the optional field type if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java index 55f4a30c1..bef3286c1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("clearingNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SELocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SELocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java index 4ef8f04c2..8cb75faf1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -232,6 +234,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("bic"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SGLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -252,7 +258,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SGLocalAccountIdentification` properties.", entry.getKey())); } } @@ -264,11 +270,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java index 3050dc143..23d7a3533 100644 --- a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java +++ b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -207,6 +209,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StringMatch.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -227,7 +233,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StringMatch` properties.", entry.getKey())); } } // ensure the field operation can be parsed to an enum value @@ -239,7 +245,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index 9c0a8962b..5dff25e55 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -753,6 +755,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("schedule"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepConfigurationV2.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -773,7 +779,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SweepConfigurationV2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SweepConfigurationV2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepConfigurationV2` properties.", entry.getKey())); } } @@ -796,19 +802,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java index 9e361ec2d..8a5d7a7b4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java @@ -243,6 +243,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with CronSweepSchedule try { + Logger.getLogger(CronSweepSchedule.class.getName()).setLevel(Level.OFF); CronSweepSchedule.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -251,6 +252,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SweepSchedule try { + Logger.getLogger(SweepSchedule.class.getName()).setLevel(Level.OFF); SweepSchedule.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java index ac5ec2724..bceb20b04 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepCounterparty.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SweepCounterparty.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SweepCounterparty` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepCounterparty` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java index d8795ec48..3b59dbb7a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -180,6 +182,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepSchedule.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -200,7 +206,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SweepSchedule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SweepSchedule` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepSchedule` properties.", entry.getKey())); } } // ensure the field type can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java index 333be404c..e3d73ad59 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("amount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThresholdRepayment.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThresholdRepayment` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java index 104301649..106956a79 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TimeOfDay.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TimeOfDay.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TimeOfDay` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TimeOfDay` properties.", entry.getKey())); } } // validate the optional field endTime if (jsonObj.get("endTime") != null && !jsonObj.get("endTime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endTime").toString())); + log.log(Level.WARNING, String.format("Expected the field `endTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endTime").toString())); } // validate the optional field startTime if (jsonObj.get("startTime") != null && !jsonObj.get("startTime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startTime").toString())); + log.log(Level.WARNING, String.format("Expected the field `startTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startTime").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java index e31370c30..deb557e77 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TimeOfDayRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TimeOfDayRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TimeOfDayRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TimeOfDayRestriction` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); } // validate the optional field `value` if (jsonObj.getAsJsonObject("value") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java index 9ff11fafa..5c7184e96 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("operation"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TotalAmountRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TotalAmountRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TotalAmountRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TotalAmountRestriction` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operation").toString())); } // validate the optional field `value` if (jsonObj.getAsJsonObject("value") != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index 8df4673df..ad761ebe8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -707,6 +709,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ruleRestrictions"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRule.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -727,7 +733,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRule.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRule` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRule` properties.", entry.getKey())); } } @@ -739,15 +745,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field aggregationLevel if (jsonObj.get("aggregationLevel") != null && !jsonObj.get("aggregationLevel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aggregationLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aggregationLevel").toString())); + log.log(Level.WARNING, String.format("Expected the field `aggregationLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aggregationLevel").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())); + log.log(Level.WARNING, 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 endDate if (jsonObj.get("endDate") != null && !jsonObj.get("endDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `endDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endDate").toString())); } // validate the optional field `entityKey` if (jsonObj.getAsJsonObject("entityKey") != null) { @@ -755,7 +761,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `interval` if (jsonObj.getAsJsonObject("interval") != null) { @@ -770,7 +776,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -785,7 +791,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field startDate if (jsonObj.get("startDate") != null && !jsonObj.get("startDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `startDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startDate").toString())); } // 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/balanceplatform/TransactionRuleEntityKey.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java index ac9e2568d..542eae109 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleEntityKey.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRuleEntityKey.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleEntityKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleEntityKey` properties.", entry.getKey())); } } // validate the optional field entityReference if (jsonObj.get("entityReference") != null && !jsonObj.get("entityReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `entityReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entityReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `entityReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entityReference").toString())); } // validate the optional field entityType if (jsonObj.get("entityType") != null && !jsonObj.get("entityType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `entityType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entityType").toString())); + log.log(Level.WARNING, String.format("Expected the field `entityType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entityType").toString())); } } diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index 187ce1885..29abf46d7 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -678,6 +680,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ruleRestrictions"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -698,7 +704,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRuleInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleInfo` properties.", entry.getKey())); } } @@ -710,15 +716,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field aggregationLevel if (jsonObj.get("aggregationLevel") != null && !jsonObj.get("aggregationLevel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aggregationLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aggregationLevel").toString())); + log.log(Level.WARNING, String.format("Expected the field `aggregationLevel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aggregationLevel").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())); + log.log(Level.WARNING, 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 endDate if (jsonObj.get("endDate") != null && !jsonObj.get("endDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `endDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endDate").toString())); } // validate the optional field `entityKey` if (jsonObj.getAsJsonObject("entityKey") != null) { @@ -737,7 +743,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -752,7 +758,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field startDate if (jsonObj.get("startDate") != null && !jsonObj.get("startDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `startDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startDate").toString())); } // 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/balanceplatform/TransactionRuleInterval.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java index 2e10cf65e..75b05d562 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -388,6 +390,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleInterval.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -408,7 +414,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRuleInterval.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleInterval` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleInterval` properties.", entry.getKey())); } } @@ -431,11 +437,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field timeOfDay if (jsonObj.get("timeOfDay") != null && !jsonObj.get("timeOfDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeOfDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeOfDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeOfDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeOfDay").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `timeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZone").toString())); } // 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/balanceplatform/TransactionRuleResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java index 3bdbed7e3..dfd248284 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRuleResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleResponse` properties.", entry.getKey())); } } // validate the optional field `transactionRule` diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java index 4c8e199dc..297186e21 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java @@ -54,6 +54,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -518,6 +520,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleRestrictions.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -538,7 +544,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRuleRestrictions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleRestrictions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleRestrictions` properties.", entry.getKey())); } } // validate the optional field `activeNetworkTokens` diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java index 0d36ae55f..a9ffd336c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRulesResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionRulesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionRulesResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRulesResponse` properties.", entry.getKey())); } } JsonArray jsonArraytransactionRules = jsonObj.getAsJsonArray("transactionRules"); diff --git a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java index 27b1ae50f..7d0ee8278 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("sortCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UKLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UKLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java index 91798841a..2cd066d2a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -309,6 +311,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("routingNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(USLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -329,7 +335,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties.", entry.getKey())); } } @@ -341,7 +347,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -352,7 +358,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java index 61c1491c1..281904c84 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -609,6 +611,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuingCountryCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdatePaymentInstrument.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -629,7 +635,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdatePaymentInstrument` properties.", entry.getKey())); } } @@ -641,7 +647,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field `bankAccount` if (jsonObj.getAsJsonObject("bankAccount") != null) { @@ -653,23 +659,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -680,7 +686,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java index 9fea30a3a..257195783 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.balanceplatform.JSON; @@ -296,6 +298,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("capabilities"); openapiRequiredFields.add("expiresAt"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VerificationDeadline.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -316,7 +322,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VerificationDeadline` properties.", entry.getKey())); } } @@ -328,7 +334,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/Amount.java b/src/main/java/com/adyen/model/binlookup/Amount.java index be8768318..ea9a4b3fd 100644 --- a/src/main/java/com/adyen/model/binlookup/Amount.java +++ b/src/main/java/com/adyen/model/binlookup/Amount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/BinDetail.java b/src/main/java/com/adyen/model/binlookup/BinDetail.java index 6d6ddcdaa..3bb632c04 100644 --- a/src/main/java/com/adyen/model/binlookup/BinDetail.java +++ b/src/main/java/com/adyen/model/binlookup/BinDetail.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BinDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,12 +154,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BinDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BinDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BinDetail` properties.", entry.getKey())); } } // validate the optional field issuerCountry if (jsonObj.get("issuerCountry") != null && !jsonObj.get("issuerCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/CardBin.java b/src/main/java/com/adyen/model/binlookup/CardBin.java index 4afc40411..1c3049838 100644 --- a/src/main/java/com/adyen/model/binlookup/CardBin.java +++ b/src/main/java/com/adyen/model/binlookup/CardBin.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -418,6 +420,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardBin.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -438,48 +444,48 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardBin.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardBin` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardBin` properties.", entry.getKey())); } } // validate the optional field bin if (jsonObj.get("bin") != null && !jsonObj.get("bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); } // validate the optional field fundingSource if (jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); + log.log(Level.WARNING, String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); } // validate the optional field fundsAvailability 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `issuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingBank").toString())); } // validate the optional field issuingCountry if (jsonObj.get("issuingCountry") != null && !jsonObj.get("issuingCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingCountry").toString())); } // validate the optional field issuingCurrency if (jsonObj.get("issuingCurrency") != null && !jsonObj.get("issuingCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuingCurrency").toString())); } // validate the optional field paymentMethod if (jsonObj.get("paymentMethod") != null && !jsonObj.get("paymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); } // validate the optional field payoutEligible if (jsonObj.get("payoutEligible") != null && !jsonObj.get("payoutEligible").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); + log.log(Level.WARNING, String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); } // validate the optional field summary if (jsonObj.get("summary") != null && !jsonObj.get("summary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); + log.log(Level.WARNING, String.format("Expected the field `summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("summary").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java index bb85e478d..f835c2976 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CostEstimateAssumptions.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,7 +212,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CostEstimateAssumptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CostEstimateAssumptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CostEstimateAssumptions` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java index c672770e1..456125c5a 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -446,6 +448,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("amount"); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CostEstimateRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -466,7 +472,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CostEstimateRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CostEstimateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CostEstimateRequest` properties.", entry.getKey())); } } @@ -486,15 +492,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cardNumber if (jsonObj.get("cardNumber") != null && !jsonObj.get("cardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").toString())); } // validate the optional field encryptedCardNumber if (jsonObj.get("encryptedCardNumber") != null && !jsonObj.get("encryptedCardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedCardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedCardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedCardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedCardNumber").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())); + log.log(Level.WARNING, 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 `merchantDetails` if (jsonObj.getAsJsonObject("merchantDetails") != null) { @@ -506,7 +512,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -517,7 +523,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java index fa3d9399c..aba9eb3ed 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -246,6 +248,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CostEstimateResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -266,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CostEstimateResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CostEstimateResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CostEstimateResponse` properties.", entry.getKey())); } } // validate the optional field `cardBin` @@ -279,15 +285,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field costEstimateReference if (jsonObj.get("costEstimateReference") != null && !jsonObj.get("costEstimateReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `costEstimateReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("costEstimateReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `costEstimateReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("costEstimateReference").toString())); } // validate the optional field resultCode if (jsonObj.get("resultCode") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } // validate the optional field surchargeType if (jsonObj.get("surchargeType") != null && !jsonObj.get("surchargeType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `surchargeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("surchargeType").toString())); + log.log(Level.WARNING, String.format("Expected the field `surchargeType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("surchargeType").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java index 31b694d31..17d7fe486 100644 --- a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java +++ b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -215,6 +217,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DSPublicKeyDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -235,20 +241,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DSPublicKeyDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DSPublicKeyDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DSPublicKeyDetail` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field directoryServerId if (jsonObj.get("directoryServerId") != null && !jsonObj.get("directoryServerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `directoryServerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("directoryServerId").toString())); + log.log(Level.WARNING, String.format("Expected the field `directoryServerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("directoryServerId").toString())); } // validate the optional field fromSDKVersion if (jsonObj.get("fromSDKVersion") != null && !jsonObj.get("fromSDKVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fromSDKVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromSDKVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `fromSDKVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fromSDKVersion").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java index 945a1b71d..d71fcad52 100644 --- a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java +++ b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,16 +212,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantDetails` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/Recurring.java b/src/main/java/com/adyen/model/binlookup/Recurring.java index ac875d701..0e8b2b5ed 100644 --- a/src/main/java/com/adyen/model/binlookup/Recurring.java +++ b/src/main/java/com/adyen/model/binlookup/Recurring.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -341,6 +343,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Recurring.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -361,7 +367,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Recurring.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties.", entry.getKey())); } } // ensure the field contract can be parsed to an enum value @@ -373,11 +379,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringDetailName if (jsonObj.get("recurringDetailName") != null && !jsonObj.get("recurringDetailName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field tokenService can be parsed to an enum value if (jsonObj.get("tokenService") != null) { diff --git a/src/main/java/com/adyen/model/binlookup/ServiceError.java b/src/main/java/com/adyen/model/binlookup/ServiceError.java index a7286353d..f1ec41b7d 100644 --- a/src/main/java/com/adyen/model/binlookup/ServiceError.java +++ b/src/main/java/com/adyen/model/binlookup/ServiceError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -284,6 +286,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -304,24 +310,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java index 2a3979a09..2ad524c82 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -291,6 +293,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2CardRangeDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -311,32 +317,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2CardRangeDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2CardRangeDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2CardRangeDetail` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("acsInfoInd") != null && !jsonObj.get("acsInfoInd").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `acsInfoInd` to be an array in the JSON string but got `%s`", jsonObj.get("acsInfoInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsInfoInd` to be an array in the JSON string but got `%s`", jsonObj.get("acsInfoInd").toString())); } // validate the optional field brandCode if (jsonObj.get("brandCode") != null && !jsonObj.get("brandCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brandCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `brandCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandCode").toString())); } // validate the optional field endRange if (jsonObj.get("endRange") != null && !jsonObj.get("endRange").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endRange").toString())); + log.log(Level.WARNING, String.format("Expected the field `endRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endRange").toString())); } // validate the optional field startRange 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())); + log.log(Level.WARNING, String.format("Expected the field `startRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startRange").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())); + log.log(Level.WARNING, 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()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSMethodURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSMethodURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSMethodURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSMethodURL").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java index 1cf6f36b8..3b82d7e89 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -294,6 +296,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSAvailabilityRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -314,7 +320,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSAvailabilityRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSAvailabilityRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSAvailabilityRequest` properties.", entry.getKey())); } } @@ -326,23 +332,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("brands") != null && !jsonObj.get("brands").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `brands` to be an array in the JSON string but got `%s`", jsonObj.get("brands").toString())); + log.log(Level.WARNING, String.format("Expected the field `brands` to be an array in the JSON string but got `%s`", jsonObj.get("brands").toString())); } // validate the optional field cardNumber if (jsonObj.get("cardNumber") != null && !jsonObj.get("cardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java index 76623d94c..cdd7bc1f8 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.binlookup.JSON; @@ -265,6 +267,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSAvailabilityResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -285,7 +291,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSAvailabilityResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSAvailabilityResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSAvailabilityResponse` properties.", entry.getKey())); } } // validate the optional field `binDetails` diff --git a/src/main/java/com/adyen/model/capital/Amount.java b/src/main/java/com/adyen/model/capital/Amount.java index c2e74bef1..6e7d448a4 100644 --- a/src/main/java/com/adyen/model/capital/Amount.java +++ b/src/main/java/com/adyen/model/capital/Amount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/CapitalBalance.java b/src/main/java/com/adyen/model/capital/CapitalBalance.java index a572c746d..d9084a3ef 100644 --- a/src/main/java/com/adyen/model/capital/CapitalBalance.java +++ b/src/main/java/com/adyen/model/capital/CapitalBalance.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -219,6 +221,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("principal"); openapiRequiredFields.add("total"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapitalBalance.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -239,7 +245,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalBalance` properties.", entry.getKey())); } } @@ -251,7 +257,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/CapitalGrant.java b/src/main/java/com/adyen/model/capital/CapitalGrant.java index 747763c3d..f2175d3e4 100644 --- a/src/main/java/com/adyen/model/capital/CapitalGrant.java +++ b/src/main/java/com/adyen/model/capital/CapitalGrant.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -419,6 +421,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapitalGrant.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -439,7 +445,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrant` properties.", entry.getKey())); } } @@ -467,15 +473,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `grantAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantAccountId").toString())); } // validate the optional field grantOfferId if (jsonObj.get("grantOfferId") != null && !jsonObj.get("grantOfferId").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `grantOfferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantOfferId").toString())); } // validate the optional field id if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `repayment` if (jsonObj.getAsJsonObject("repayment") != null) { diff --git a/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java b/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java index 2860d2995..6f71421aa 100644 --- a/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java +++ b/src/main/java/com/adyen/model/capital/CapitalGrantInfo.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -189,6 +191,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("grantAccountId"); openapiRequiredFields.add("grantOfferId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapitalGrantInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -209,7 +215,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrantInfo` properties.", entry.getKey())); } } @@ -225,11 +231,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `grantAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantAccountId").toString())); } // validate the optional field grantOfferId if (jsonObj.get("grantOfferId") != null && !jsonObj.get("grantOfferId").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `grantOfferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grantOfferId").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/CapitalGrants.java b/src/main/java/com/adyen/model/capital/CapitalGrants.java index 6b0f0ff08..e3253c499 100644 --- a/src/main/java/com/adyen/model/capital/CapitalGrants.java +++ b/src/main/java/com/adyen/model/capital/CapitalGrants.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("grants"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapitalGrants.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,7 +163,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapitalGrants` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/capital/Counterparty.java b/src/main/java/com/adyen/model/capital/Counterparty.java index 8fe2b76d7..e9eaeda93 100644 --- a/src/main/java/com/adyen/model/capital/Counterparty.java +++ b/src/main/java/com/adyen/model/capital/Counterparty.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Counterparty.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Counterparty` properties.", entry.getKey())); } } // validate the optional field accountHolderId if (jsonObj.get("accountHolderId") != null && !jsonObj.get("accountHolderId").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } // validate the optional field balanceAccountId if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field transferInstrumentId if (jsonObj.get("transferInstrumentId") != null && !jsonObj.get("transferInstrumentId").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/Fee.java b/src/main/java/com/adyen/model/capital/Fee.java index 4b31478c0..c2243388a 100644 --- a/src/main/java/com/adyen/model/capital/Fee.java +++ b/src/main/java/com/adyen/model/capital/Fee.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -130,6 +132,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("amount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Fee.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -150,7 +156,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Fee` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/capital/InvalidField.java b/src/main/java/com/adyen/model/capital/InvalidField.java index 60a2cf06f..fb54d2d34 100644 --- a/src/main/java/com/adyen/model/capital/InvalidField.java +++ b/src/main/java/com/adyen/model/capital/InvalidField.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -189,6 +191,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InvalidField.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -209,7 +215,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InvalidField` properties.", entry.getKey())); } } @@ -221,15 +227,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field name if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field value if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/JSONObject.java b/src/main/java/com/adyen/model/capital/JSONObject.java index 92ab1962a..a3ebce9d3 100644 --- a/src/main/java/com/adyen/model/capital/JSONObject.java +++ b/src/main/java/com/adyen/model/capital/JSONObject.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONObject.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties.", entry.getKey())); } } JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); diff --git a/src/main/java/com/adyen/model/capital/JSONPath.java b/src/main/java/com/adyen/model/capital/JSONPath.java index 6bfdc008a..22cc84e15 100644 --- a/src/main/java/com/adyen/model/capital/JSONPath.java +++ b/src/main/java/com/adyen/model/capital/JSONPath.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONPath.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,12 +164,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); + log.log(Level.WARNING, String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/Repayment.java b/src/main/java/com/adyen/model/capital/Repayment.java index 22d4f9ed3..20068108e 100644 --- a/src/main/java/com/adyen/model/capital/Repayment.java +++ b/src/main/java/com/adyen/model/capital/Repayment.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -189,6 +191,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("basisPoints"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Repayment.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -209,7 +215,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Repayment` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/capital/RepaymentTerm.java b/src/main/java/com/adyen/model/capital/RepaymentTerm.java index 8a77b59b1..72f611c3a 100644 --- a/src/main/java/com/adyen/model/capital/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/capital/RepaymentTerm.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("estimatedDays"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RepaymentTerm.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RepaymentTerm` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/capital/RestServiceError.java b/src/main/java/com/adyen/model/capital/RestServiceError.java index 9c27cb36e..9e954132f 100644 --- a/src/main/java/com/adyen/model/capital/RestServiceError.java +++ b/src/main/java/com/adyen/model/capital/RestServiceError.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -377,6 +379,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("title"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RestServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -397,7 +403,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RestServiceError` properties.", entry.getKey())); } } @@ -409,15 +415,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); } // validate the optional field errorCode if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field instance if (jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); } JsonArray jsonArrayinvalidFields = jsonObj.getAsJsonArray("invalidFields"); if (jsonArrayinvalidFields != null) { @@ -433,7 +439,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); } // validate the optional field `response` if (jsonObj.getAsJsonObject("response") != null) { @@ -441,11 +447,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } // validate the optional field type if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/capital/ThresholdRepayment.java b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java index 06e58a494..cd3f18e2e 100644 --- a/src/main/java/com/adyen/model/capital/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/capital/ThresholdRepayment.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.capital.JSON; @@ -130,6 +132,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("amount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThresholdRepayment.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -150,7 +156,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThresholdRepayment` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/checkout/AccountInfo.java b/src/main/java/com/adyen/model/checkout/AccountInfo.java index 1057b6350..1bc8340b0 100644 --- a/src/main/java/com/adyen/model/checkout/AccountInfo.java +++ b/src/main/java/com/adyen/model/checkout/AccountInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -975,6 +977,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -995,7 +1001,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AccountInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountInfo` properties.", entry.getKey())); } } // ensure the field accountAgeIndicator can be parsed to an enum value @@ -1028,11 +1034,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field homePhone if (jsonObj.get("homePhone") != null && !jsonObj.get("homePhone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `homePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("homePhone").toString())); + log.log(Level.WARNING, String.format("Expected the field `homePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("homePhone").toString())); } // validate the optional field mobilePhone if (jsonObj.get("mobilePhone") != null && !jsonObj.get("mobilePhone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mobilePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobilePhone").toString())); + log.log(Level.WARNING, String.format("Expected the field `mobilePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobilePhone").toString())); } // ensure the field passwordChangeIndicator can be parsed to an enum value if (jsonObj.get("passwordChangeIndicator") != null) { @@ -1050,7 +1056,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field workPhone if (jsonObj.get("workPhone") != null && !jsonObj.get("workPhone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `workPhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workPhone").toString())); + log.log(Level.WARNING, String.format("Expected the field `workPhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workPhone").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AcctInfo.java b/src/main/java/com/adyen/model/checkout/AcctInfo.java index e204ee8e6..01f2555c5 100644 --- a/src/main/java/com/adyen/model/checkout/AcctInfo.java +++ b/src/main/java/com/adyen/model/checkout/AcctInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -917,6 +919,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AcctInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -937,7 +943,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AcctInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcctInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AcctInfo` properties.", entry.getKey())); } } // ensure the field chAccAgeInd can be parsed to an enum value @@ -949,7 +955,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field chAccChange if (jsonObj.get("chAccChange") != null && !jsonObj.get("chAccChange").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `chAccChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccChange").toString())); + log.log(Level.WARNING, String.format("Expected the field `chAccChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccChange").toString())); } // ensure the field chAccChangeInd can be parsed to an enum value if (jsonObj.get("chAccChangeInd") != null) { @@ -960,7 +966,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field chAccPwChange if (jsonObj.get("chAccPwChange") != null && !jsonObj.get("chAccPwChange").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `chAccPwChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccPwChange").toString())); + log.log(Level.WARNING, String.format("Expected the field `chAccPwChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccPwChange").toString())); } // ensure the field chAccPwChangeInd can be parsed to an enum value if (jsonObj.get("chAccPwChangeInd") != null) { @@ -971,15 +977,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field chAccString if (jsonObj.get("chAccString") != null && !jsonObj.get("chAccString").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `chAccString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccString").toString())); + log.log(Level.WARNING, String.format("Expected the field `chAccString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccString").toString())); } // validate the optional field nbPurchaseAccount if (jsonObj.get("nbPurchaseAccount") != null && !jsonObj.get("nbPurchaseAccount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nbPurchaseAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nbPurchaseAccount").toString())); + log.log(Level.WARNING, String.format("Expected the field `nbPurchaseAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nbPurchaseAccount").toString())); } // validate the optional field paymentAccAge if (jsonObj.get("paymentAccAge") != null && !jsonObj.get("paymentAccAge").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAccAge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccAge").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAccAge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccAge").toString())); } // ensure the field paymentAccInd can be parsed to an enum value if (jsonObj.get("paymentAccInd") != null) { @@ -990,11 +996,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field provisionAttemptsDay if (jsonObj.get("provisionAttemptsDay") != null && !jsonObj.get("provisionAttemptsDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `provisionAttemptsDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provisionAttemptsDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `provisionAttemptsDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provisionAttemptsDay").toString())); } // validate the optional field shipAddressUsage if (jsonObj.get("shipAddressUsage") != null && !jsonObj.get("shipAddressUsage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shipAddressUsage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipAddressUsage").toString())); + log.log(Level.WARNING, String.format("Expected the field `shipAddressUsage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipAddressUsage").toString())); } // ensure the field shipAddressUsageInd can be parsed to an enum value if (jsonObj.get("shipAddressUsageInd") != null) { @@ -1019,11 +1025,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field txnActivityDay if (jsonObj.get("txnActivityDay") != null && !jsonObj.get("txnActivityDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txnActivityDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `txnActivityDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityDay").toString())); } // validate the optional field txnActivityYear if (jsonObj.get("txnActivityYear") != null && !jsonObj.get("txnActivityYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txnActivityYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `txnActivityYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityYear").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AchDetails.java b/src/main/java/com/adyen/model/checkout/AchDetails.java index 9806198be..c3295358a 100644 --- a/src/main/java/com/adyen/model/checkout/AchDetails.java +++ b/src/main/java/com/adyen/model/checkout/AchDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -412,6 +414,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("bankAccountNumber"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AchDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -432,7 +438,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AchDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AchDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AchDetails` properties.", entry.getKey())); } } @@ -444,35 +450,35 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field bankAccountNumber if (jsonObj.get("bankAccountNumber") != null && !jsonObj.get("bankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); } // validate the optional field bankLocationId if (jsonObj.get("bankLocationId") != null && !jsonObj.get("bankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field encryptedBankAccountNumber if (jsonObj.get("encryptedBankAccountNumber") != null && !jsonObj.get("encryptedBankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedBankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedBankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedBankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedBankAccountNumber").toString())); } // validate the optional field encryptedBankLocationId if (jsonObj.get("encryptedBankLocationId") != null && !jsonObj.get("encryptedBankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedBankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedBankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedBankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedBankLocationId").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java index 19fc234d1..6cb71d766 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -335,6 +337,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalData3DSecure.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -355,12 +361,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalData3DSecure.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalData3DSecure` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalData3DSecure` properties.", entry.getKey())); } } // validate the optional field allow3DS2 if (jsonObj.get("allow3DS2") != null && !jsonObj.get("allow3DS2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `allow3DS2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allow3DS2").toString())); + log.log(Level.WARNING, String.format("Expected the field `allow3DS2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allow3DS2").toString())); } // ensure the field challengeWindowSize can be parsed to an enum value if (jsonObj.get("challengeWindowSize") != null) { @@ -371,19 +377,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field executeThreeD if (jsonObj.get("executeThreeD") != null && !jsonObj.get("executeThreeD").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `executeThreeD` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executeThreeD").toString())); + log.log(Level.WARNING, String.format("Expected the field `executeThreeD` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executeThreeD").toString())); } // validate the optional field mpiImplementationType if (jsonObj.get("mpiImplementationType") != null && !jsonObj.get("mpiImplementationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mpiImplementationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mpiImplementationType").toString())); + log.log(Level.WARNING, String.format("Expected the field `mpiImplementationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mpiImplementationType").toString())); } // validate the optional field scaExemption if (jsonObj.get("scaExemption") != null && !jsonObj.get("scaExemption").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scaExemption` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemption").toString())); + log.log(Level.WARNING, String.format("Expected the field `scaExemption` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemption").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java index d9116d98b..831a5c8ea 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -911,6 +913,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("airline.passenger_name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataAirline.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -931,7 +937,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataAirline.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataAirline` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataAirline` properties.", entry.getKey())); } } @@ -943,115 +949,115 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field airline.agency_invoice_number if (jsonObj.get("airline.agency_invoice_number") != null && !jsonObj.get("airline.agency_invoice_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.agency_invoice_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_invoice_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.agency_invoice_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_invoice_number").toString())); } // validate the optional field airline.agency_plan_name if (jsonObj.get("airline.agency_plan_name") != null && !jsonObj.get("airline.agency_plan_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.agency_plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_plan_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.agency_plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_plan_name").toString())); } // validate the optional field airline.airline_code if (jsonObj.get("airline.airline_code") != null && !jsonObj.get("airline.airline_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.airline_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.airline_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_code").toString())); } // validate the optional field airline.airline_designator_code if (jsonObj.get("airline.airline_designator_code") != null && !jsonObj.get("airline.airline_designator_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.airline_designator_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_designator_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.airline_designator_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_designator_code").toString())); } // validate the optional field airline.boarding_fee if (jsonObj.get("airline.boarding_fee") != null && !jsonObj.get("airline.boarding_fee").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.boarding_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.boarding_fee").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.boarding_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.boarding_fee").toString())); } // validate the optional field airline.computerized_reservation_system if (jsonObj.get("airline.computerized_reservation_system") != null && !jsonObj.get("airline.computerized_reservation_system").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.computerized_reservation_system` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.computerized_reservation_system").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.computerized_reservation_system` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.computerized_reservation_system").toString())); } // validate the optional field airline.customer_reference_number if (jsonObj.get("airline.customer_reference_number") != null && !jsonObj.get("airline.customer_reference_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.customer_reference_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.customer_reference_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.customer_reference_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.customer_reference_number").toString())); } // validate the optional field airline.document_type if (jsonObj.get("airline.document_type") != null && !jsonObj.get("airline.document_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.document_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.document_type").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.document_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.document_type").toString())); } // validate the optional field airline.flight_date if (jsonObj.get("airline.flight_date") != null && !jsonObj.get("airline.flight_date").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.flight_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.flight_date").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.flight_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.flight_date").toString())); } // validate the optional field airline.leg.carrier_code if (jsonObj.get("airline.leg.carrier_code") != null && !jsonObj.get("airline.leg.carrier_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.carrier_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.carrier_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.carrier_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.carrier_code").toString())); } // validate the optional field airline.leg.class_of_travel if (jsonObj.get("airline.leg.class_of_travel") != null && !jsonObj.get("airline.leg.class_of_travel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.class_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.class_of_travel").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.class_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.class_of_travel").toString())); } // validate the optional field airline.leg.date_of_travel if (jsonObj.get("airline.leg.date_of_travel") != null && !jsonObj.get("airline.leg.date_of_travel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.date_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.date_of_travel").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.date_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.date_of_travel").toString())); } // validate the optional field airline.leg.depart_airport if (jsonObj.get("airline.leg.depart_airport") != null && !jsonObj.get("airline.leg.depart_airport").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.depart_airport` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_airport").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.depart_airport` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_airport").toString())); } // validate the optional field airline.leg.depart_tax if (jsonObj.get("airline.leg.depart_tax") != null && !jsonObj.get("airline.leg.depart_tax").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.depart_tax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_tax").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.depart_tax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_tax").toString())); } // validate the optional field airline.leg.destination_code if (jsonObj.get("airline.leg.destination_code") != null && !jsonObj.get("airline.leg.destination_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.destination_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.destination_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.destination_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.destination_code").toString())); } // validate the optional field airline.leg.fare_base_code if (jsonObj.get("airline.leg.fare_base_code") != null && !jsonObj.get("airline.leg.fare_base_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.fare_base_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.fare_base_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.fare_base_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.fare_base_code").toString())); } // validate the optional field airline.leg.flight_number if (jsonObj.get("airline.leg.flight_number") != null && !jsonObj.get("airline.leg.flight_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.flight_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.flight_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.flight_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.flight_number").toString())); } // validate the optional field airline.leg.stop_over_code if (jsonObj.get("airline.leg.stop_over_code") != null && !jsonObj.get("airline.leg.stop_over_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.stop_over_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.stop_over_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.stop_over_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.stop_over_code").toString())); } // validate the optional field airline.passenger.date_of_birth if (jsonObj.get("airline.passenger.date_of_birth") != null && !jsonObj.get("airline.passenger.date_of_birth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.date_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.date_of_birth").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.date_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.date_of_birth").toString())); } // validate the optional field airline.passenger.first_name if (jsonObj.get("airline.passenger.first_name") != null && !jsonObj.get("airline.passenger.first_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.first_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.first_name").toString())); } // validate the optional field airline.passenger.last_name if (jsonObj.get("airline.passenger.last_name") != null && !jsonObj.get("airline.passenger.last_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.last_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.last_name").toString())); } // validate the optional field airline.passenger.telephone_number if (jsonObj.get("airline.passenger.telephone_number") != null && !jsonObj.get("airline.passenger.telephone_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.telephone_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.telephone_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.telephone_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.telephone_number").toString())); } // validate the optional field airline.passenger.traveller_type if (jsonObj.get("airline.passenger.traveller_type") != null && !jsonObj.get("airline.passenger.traveller_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.traveller_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.traveller_type").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.traveller_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.traveller_type").toString())); } // validate the optional field airline.passenger_name if (jsonObj.get("airline.passenger_name") != null && !jsonObj.get("airline.passenger_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger_name").toString())); } // validate the optional field airline.ticket_issue_address if (jsonObj.get("airline.ticket_issue_address") != null && !jsonObj.get("airline.ticket_issue_address").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.ticket_issue_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_issue_address").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.ticket_issue_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_issue_address").toString())); } // validate the optional field airline.ticket_number if (jsonObj.get("airline.ticket_number") != null && !jsonObj.get("airline.ticket_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.ticket_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.ticket_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_number").toString())); } // validate the optional field airline.travel_agency_code if (jsonObj.get("airline.travel_agency_code") != null && !jsonObj.get("airline.travel_agency_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.travel_agency_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.travel_agency_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_code").toString())); } // validate the optional field airline.travel_agency_name if (jsonObj.get("airline.travel_agency_name") != null && !jsonObj.get("airline.travel_agency_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.travel_agency_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.travel_agency_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_name").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java index 2459aa630..f06efc14e 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -765,6 +767,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataCarRental.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -785,100 +791,100 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataCarRental.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCarRental` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCarRental` properties.", entry.getKey())); } } // validate the optional field carRental.checkOutDate if (jsonObj.get("carRental.checkOutDate") != null && !jsonObj.get("carRental.checkOutDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.checkOutDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.checkOutDate").toString())); } // validate the optional field carRental.customerServiceTollFreeNumber if (jsonObj.get("carRental.customerServiceTollFreeNumber") != null && !jsonObj.get("carRental.customerServiceTollFreeNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.customerServiceTollFreeNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.customerServiceTollFreeNumber").toString())); } // validate the optional field carRental.daysRented if (jsonObj.get("carRental.daysRented") != null && !jsonObj.get("carRental.daysRented").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.daysRented` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.daysRented").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.daysRented` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.daysRented").toString())); } // validate the optional field carRental.fuelCharges if (jsonObj.get("carRental.fuelCharges") != null && !jsonObj.get("carRental.fuelCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.fuelCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.fuelCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.fuelCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.fuelCharges").toString())); } // validate the optional field carRental.insuranceCharges if (jsonObj.get("carRental.insuranceCharges") != null && !jsonObj.get("carRental.insuranceCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.insuranceCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.insuranceCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.insuranceCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.insuranceCharges").toString())); } // validate the optional field carRental.locationCity if (jsonObj.get("carRental.locationCity") != null && !jsonObj.get("carRental.locationCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.locationCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.locationCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCity").toString())); } // validate the optional field carRental.locationCountry if (jsonObj.get("carRental.locationCountry") != null && !jsonObj.get("carRental.locationCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.locationCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.locationCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCountry").toString())); } // validate the optional field carRental.locationStateProvince if (jsonObj.get("carRental.locationStateProvince") != null && !jsonObj.get("carRental.locationStateProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.locationStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationStateProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.locationStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationStateProvince").toString())); } // validate the optional field carRental.noShowIndicator if (jsonObj.get("carRental.noShowIndicator") != null && !jsonObj.get("carRental.noShowIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.noShowIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.noShowIndicator").toString())); } // validate the optional field carRental.oneWayDropOffCharges if (jsonObj.get("carRental.oneWayDropOffCharges") != null && !jsonObj.get("carRental.oneWayDropOffCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.oneWayDropOffCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.oneWayDropOffCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.oneWayDropOffCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.oneWayDropOffCharges").toString())); } // validate the optional field carRental.rate if (jsonObj.get("carRental.rate") != null && !jsonObj.get("carRental.rate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rate").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rate").toString())); } // validate the optional field carRental.rateIndicator if (jsonObj.get("carRental.rateIndicator") != null && !jsonObj.get("carRental.rateIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rateIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rateIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rateIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rateIndicator").toString())); } // validate the optional field carRental.rentalAgreementNumber if (jsonObj.get("carRental.rentalAgreementNumber") != null && !jsonObj.get("carRental.rentalAgreementNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rentalAgreementNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalAgreementNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rentalAgreementNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalAgreementNumber").toString())); } // validate the optional field carRental.rentalClassId if (jsonObj.get("carRental.rentalClassId") != null && !jsonObj.get("carRental.rentalClassId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rentalClassId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalClassId").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rentalClassId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalClassId").toString())); } // validate the optional field carRental.renterName if (jsonObj.get("carRental.renterName") != null && !jsonObj.get("carRental.renterName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.renterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.renterName").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.renterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.renterName").toString())); } // validate the optional field carRental.returnCity if (jsonObj.get("carRental.returnCity") != null && !jsonObj.get("carRental.returnCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCity").toString())); } // validate the optional field carRental.returnCountry if (jsonObj.get("carRental.returnCountry") != null && !jsonObj.get("carRental.returnCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCountry").toString())); } // validate the optional field carRental.returnDate if (jsonObj.get("carRental.returnDate") != null && !jsonObj.get("carRental.returnDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnDate").toString())); } // validate the optional field carRental.returnLocationId if (jsonObj.get("carRental.returnLocationId") != null && !jsonObj.get("carRental.returnLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnLocationId").toString())); } // validate the optional field carRental.returnStateProvince if (jsonObj.get("carRental.returnStateProvince") != null && !jsonObj.get("carRental.returnStateProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnStateProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnStateProvince").toString())); } // validate the optional field carRental.taxExemptIndicator if (jsonObj.get("carRental.taxExemptIndicator") != null && !jsonObj.get("carRental.taxExemptIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.taxExemptIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.taxExemptIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.taxExemptIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.taxExemptIndicator").toString())); } // validate the optional field travelEntertainmentAuthData.duration if (jsonObj.get("travelEntertainmentAuthData.duration") != null && !jsonObj.get("travelEntertainmentAuthData.duration").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); } // validate the optional field travelEntertainmentAuthData.market if (jsonObj.get("travelEntertainmentAuthData.market") != null && !jsonObj.get("travelEntertainmentAuthData.market").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java index bed3295cb..936d69804 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -609,6 +611,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataCommon.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -629,24 +635,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataCommon.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCommon` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCommon` properties.", entry.getKey())); } } // validate the optional field RequestedTestErrorResponseCode if (jsonObj.get("RequestedTestErrorResponseCode") != null && !jsonObj.get("RequestedTestErrorResponseCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `RequestedTestErrorResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestedTestErrorResponseCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `RequestedTestErrorResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestedTestErrorResponseCode").toString())); } // validate the optional field allowPartialAuth if (jsonObj.get("allowPartialAuth") != null && !jsonObj.get("allowPartialAuth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `allowPartialAuth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allowPartialAuth").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowPartialAuth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allowPartialAuth").toString())); } // validate the optional field authorisationType if (jsonObj.get("authorisationType") != null && !jsonObj.get("authorisationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationType").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationType").toString())); } // validate the optional field customRoutingFlag if (jsonObj.get("customRoutingFlag") != null && !jsonObj.get("customRoutingFlag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `customRoutingFlag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customRoutingFlag").toString())); + log.log(Level.WARNING, String.format("Expected the field `customRoutingFlag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customRoutingFlag").toString())); } // ensure the field industryUsage can be parsed to an enum value if (jsonObj.get("industryUsage") != null) { @@ -657,47 +663,47 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field manualCapture if (jsonObj.get("manualCapture") != null && !jsonObj.get("manualCapture").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `manualCapture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manualCapture").toString())); + log.log(Level.WARNING, String.format("Expected the field `manualCapture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manualCapture").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field overwriteBrand if (jsonObj.get("overwriteBrand") != null && !jsonObj.get("overwriteBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `overwriteBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("overwriteBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `overwriteBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("overwriteBrand").toString())); } // validate the optional field subMerchantCity if (jsonObj.get("subMerchantCity") != null && !jsonObj.get("subMerchantCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCity").toString())); } // validate the optional field subMerchantCountry if (jsonObj.get("subMerchantCountry") != null && !jsonObj.get("subMerchantCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCountry").toString())); } // validate the optional field subMerchantID if (jsonObj.get("subMerchantID") != null && !jsonObj.get("subMerchantID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantID").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantID").toString())); } // validate the optional field subMerchantName if (jsonObj.get("subMerchantName") != null && !jsonObj.get("subMerchantName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantName").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantName").toString())); } // validate the optional field subMerchantPostalCode if (jsonObj.get("subMerchantPostalCode") != null && !jsonObj.get("subMerchantPostalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantPostalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantPostalCode").toString())); } // validate the optional field subMerchantState if (jsonObj.get("subMerchantState") != null && !jsonObj.get("subMerchantState").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantState").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantState").toString())); } // validate the optional field subMerchantStreet if (jsonObj.get("subMerchantStreet") != null && !jsonObj.get("subMerchantStreet").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantStreet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantStreet").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantStreet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantStreet").toString())); } // validate the optional field subMerchantTaxId if (jsonObj.get("subMerchantTaxId") != null && !jsonObj.get("subMerchantTaxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantTaxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantTaxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantTaxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantTaxId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java index 2ab430ee4..a40d805c6 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -591,6 +593,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataLevel23.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -611,76 +617,76 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataLevel23.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLevel23` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLevel23` properties.", entry.getKey())); } } // validate the optional field enhancedSchemeData.customerReference if (jsonObj.get("enhancedSchemeData.customerReference") != null && !jsonObj.get("enhancedSchemeData.customerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); } // validate the optional field enhancedSchemeData.destinationCountryCode if (jsonObj.get("enhancedSchemeData.destinationCountryCode") != null && !jsonObj.get("enhancedSchemeData.destinationCountryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.destinationCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationCountryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.destinationCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationCountryCode").toString())); } // validate the optional field enhancedSchemeData.destinationPostalCode if (jsonObj.get("enhancedSchemeData.destinationPostalCode") != null && !jsonObj.get("enhancedSchemeData.destinationPostalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.destinationPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationPostalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.destinationPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationPostalCode").toString())); } // validate the optional field enhancedSchemeData.destinationStateProvinceCode if (jsonObj.get("enhancedSchemeData.destinationStateProvinceCode") != null && !jsonObj.get("enhancedSchemeData.destinationStateProvinceCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.destinationStateProvinceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationStateProvinceCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.destinationStateProvinceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationStateProvinceCode").toString())); } // validate the optional field enhancedSchemeData.dutyAmount if (jsonObj.get("enhancedSchemeData.dutyAmount") != null && !jsonObj.get("enhancedSchemeData.dutyAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.dutyAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.dutyAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.dutyAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.dutyAmount").toString())); } // validate the optional field enhancedSchemeData.freightAmount if (jsonObj.get("enhancedSchemeData.freightAmount") != null && !jsonObj.get("enhancedSchemeData.freightAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.freightAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.freightAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.freightAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.freightAmount").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].commodityCode if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].commodityCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].commodityCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].description if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].discountAmount if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].discountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].discountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].productCode if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].productCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].productCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].quantity if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].totalAmount if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].totalAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].totalAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].unitPrice if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice").toString())); } // validate the optional field enhancedSchemeData.orderDate if (jsonObj.get("enhancedSchemeData.orderDate") != null && !jsonObj.get("enhancedSchemeData.orderDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.orderDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.orderDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.orderDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.orderDate").toString())); } // validate the optional field enhancedSchemeData.shipFromPostalCode if (jsonObj.get("enhancedSchemeData.shipFromPostalCode") != null && !jsonObj.get("enhancedSchemeData.shipFromPostalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.shipFromPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.shipFromPostalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.shipFromPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.shipFromPostalCode").toString())); } // validate the optional field enhancedSchemeData.totalTaxAmount if (jsonObj.get("enhancedSchemeData.totalTaxAmount") != null && !jsonObj.get("enhancedSchemeData.totalTaxAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java index 8d064545f..c9de6ab4d 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -562,6 +564,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataLodging.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -582,72 +588,72 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataLodging.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLodging` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLodging` properties.", entry.getKey())); } } // validate the optional field lodging.checkInDate if (jsonObj.get("lodging.checkInDate") != null && !jsonObj.get("lodging.checkInDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.checkInDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkInDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.checkInDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkInDate").toString())); } // validate the optional field lodging.checkOutDate if (jsonObj.get("lodging.checkOutDate") != null && !jsonObj.get("lodging.checkOutDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkOutDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkOutDate").toString())); } // validate the optional field lodging.customerServiceTollFreeNumber if (jsonObj.get("lodging.customerServiceTollFreeNumber") != null && !jsonObj.get("lodging.customerServiceTollFreeNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.customerServiceTollFreeNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.customerServiceTollFreeNumber").toString())); } // validate the optional field lodging.fireSafetyActIndicator if (jsonObj.get("lodging.fireSafetyActIndicator") != null && !jsonObj.get("lodging.fireSafetyActIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.fireSafetyActIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.fireSafetyActIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.fireSafetyActIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.fireSafetyActIndicator").toString())); } // validate the optional field lodging.folioCashAdvances if (jsonObj.get("lodging.folioCashAdvances") != null && !jsonObj.get("lodging.folioCashAdvances").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.folioCashAdvances` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioCashAdvances").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.folioCashAdvances` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioCashAdvances").toString())); } // validate the optional field lodging.folioNumber if (jsonObj.get("lodging.folioNumber") != null && !jsonObj.get("lodging.folioNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.folioNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.folioNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioNumber").toString())); } // validate the optional field lodging.foodBeverageCharges if (jsonObj.get("lodging.foodBeverageCharges") != null && !jsonObj.get("lodging.foodBeverageCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.foodBeverageCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.foodBeverageCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.foodBeverageCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.foodBeverageCharges").toString())); } // validate the optional field lodging.noShowIndicator if (jsonObj.get("lodging.noShowIndicator") != null && !jsonObj.get("lodging.noShowIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.noShowIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.noShowIndicator").toString())); } // validate the optional field lodging.prepaidExpenses if (jsonObj.get("lodging.prepaidExpenses") != null && !jsonObj.get("lodging.prepaidExpenses").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.prepaidExpenses` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.prepaidExpenses").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.prepaidExpenses` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.prepaidExpenses").toString())); } // validate the optional field lodging.propertyPhoneNumber if (jsonObj.get("lodging.propertyPhoneNumber") != null && !jsonObj.get("lodging.propertyPhoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.propertyPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.propertyPhoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.propertyPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.propertyPhoneNumber").toString())); } // validate the optional field lodging.room1.numberOfNights if (jsonObj.get("lodging.room1.numberOfNights") != null && !jsonObj.get("lodging.room1.numberOfNights").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.room1.numberOfNights` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.room1.numberOfNights").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.room1.numberOfNights` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.room1.numberOfNights").toString())); } // validate the optional field lodging.room1.rate 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())); + log.log(Level.WARNING, 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.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())); + log.log(Level.WARNING, String.format("Expected the field `lodging.totalRoomTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalRoomTax").toString())); } // validate the optional field lodging.totalTax if (jsonObj.get("lodging.totalTax") != null && !jsonObj.get("lodging.totalTax").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.totalTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalTax").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.totalTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalTax").toString())); } // validate the optional field travelEntertainmentAuthData.duration if (jsonObj.get("travelEntertainmentAuthData.duration") != null && !jsonObj.get("travelEntertainmentAuthData.duration").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); } // validate the optional field travelEntertainmentAuthData.market if (jsonObj.get("travelEntertainmentAuthData.market") != null && !jsonObj.get("travelEntertainmentAuthData.market").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java index 234e22f7e..21b860498 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -620,6 +622,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataOpenInvoice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -640,80 +646,80 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataOpenInvoice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpenInvoice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpenInvoice` properties.", entry.getKey())); } } // validate the optional field openinvoicedata.merchantData if (jsonObj.get("openinvoicedata.merchantData") != null && !jsonObj.get("openinvoicedata.merchantData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.merchantData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.merchantData").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.merchantData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.merchantData").toString())); } // validate the optional field openinvoicedata.numberOfLines if (jsonObj.get("openinvoicedata.numberOfLines") != null && !jsonObj.get("openinvoicedata.numberOfLines").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.numberOfLines` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.numberOfLines").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.numberOfLines` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.numberOfLines").toString())); } // validate the optional field openinvoicedata.recipientFirstName if (jsonObj.get("openinvoicedata.recipientFirstName") != null && !jsonObj.get("openinvoicedata.recipientFirstName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.recipientFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientFirstName").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.recipientFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientFirstName").toString())); } // validate the optional field openinvoicedata.recipientLastName if (jsonObj.get("openinvoicedata.recipientLastName") != null && !jsonObj.get("openinvoicedata.recipientLastName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.recipientLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientLastName").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.recipientLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientLastName").toString())); } // validate the optional field openinvoicedataLine[itemNr].currencyCode if (jsonObj.get("openinvoicedataLine[itemNr].currencyCode") != null && !jsonObj.get("openinvoicedataLine[itemNr].currencyCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].currencyCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].currencyCode").toString())); } // validate the optional field openinvoicedataLine[itemNr].description if (jsonObj.get("openinvoicedataLine[itemNr].description") != null && !jsonObj.get("openinvoicedataLine[itemNr].description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].description").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].description").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemAmount if (jsonObj.get("openinvoicedataLine[itemNr].itemAmount") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemAmount").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemId if (jsonObj.get("openinvoicedataLine[itemNr].itemId") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemId").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemId").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemVatAmount if (jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemVatAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemVatAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemVatPercentage if (jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemVatPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemVatPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage").toString())); } // validate the optional field openinvoicedataLine[itemNr].numberOfItems if (jsonObj.get("openinvoicedataLine[itemNr].numberOfItems") != null && !jsonObj.get("openinvoicedataLine[itemNr].numberOfItems").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].numberOfItems` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].numberOfItems").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].numberOfItems` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].numberOfItems").toString())); } // validate the optional field openinvoicedataLine[itemNr].returnShippingCompany if (jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany") != null && !jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].returnShippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].returnShippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany").toString())); } // validate the optional field openinvoicedataLine[itemNr].returnTrackingNumber if (jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber") != null && !jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber").toString())); } // validate the optional field openinvoicedataLine[itemNr].returnTrackingUri if (jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri") != null && !jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri").toString())); } // validate the optional field openinvoicedataLine[itemNr].shippingCompany if (jsonObj.get("openinvoicedataLine[itemNr].shippingCompany") != null && !jsonObj.get("openinvoicedataLine[itemNr].shippingCompany").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].shippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingCompany").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].shippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingCompany").toString())); } // validate the optional field openinvoicedataLine[itemNr].shippingMethod if (jsonObj.get("openinvoicedataLine[itemNr].shippingMethod") != null && !jsonObj.get("openinvoicedataLine[itemNr].shippingMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].shippingMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].shippingMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingMethod").toString())); } // validate the optional field openinvoicedataLine[itemNr].trackingNumber if (jsonObj.get("openinvoicedataLine[itemNr].trackingNumber") != null && !jsonObj.get("openinvoicedataLine[itemNr].trackingNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].trackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].trackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingNumber").toString())); } // validate the optional field openinvoicedataLine[itemNr].trackingUri if (jsonObj.get("openinvoicedataLine[itemNr].trackingUri") != null && !jsonObj.get("openinvoicedataLine[itemNr].trackingUri").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].trackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingUri").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].trackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingUri").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java b/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java index ad15c3cac..737d03b50 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataOpi.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataOpi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpi` properties.", entry.getKey())); } } // validate the optional field opi.includeTransToken if (jsonObj.get("opi.includeTransToken") != null && !jsonObj.get("opi.includeTransToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `opi.includeTransToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.includeTransToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `opi.includeTransToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.includeTransToken").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java index 9772f50ab..49e7c3017 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -330,6 +332,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRatepay.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -350,40 +356,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRatepay.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRatepay` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRatepay` properties.", entry.getKey())); } } // validate the optional field ratepay.installmentAmount if (jsonObj.get("ratepay.installmentAmount") != null && !jsonObj.get("ratepay.installmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.installmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.installmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.installmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.installmentAmount").toString())); } // validate the optional field ratepay.interestRate if (jsonObj.get("ratepay.interestRate") != null && !jsonObj.get("ratepay.interestRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.interestRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.interestRate").toString())); } // validate the optional field ratepay.lastInstallmentAmount if (jsonObj.get("ratepay.lastInstallmentAmount") != null && !jsonObj.get("ratepay.lastInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.lastInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.lastInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.lastInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.lastInstallmentAmount").toString())); } // validate the optional field ratepay.paymentFirstday if (jsonObj.get("ratepay.paymentFirstday") != null && !jsonObj.get("ratepay.paymentFirstday").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.paymentFirstday` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.paymentFirstday").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.paymentFirstday` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.paymentFirstday").toString())); } // validate the optional field ratepaydata.deliveryDate if (jsonObj.get("ratepaydata.deliveryDate") != null && !jsonObj.get("ratepaydata.deliveryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.deliveryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.deliveryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.deliveryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.deliveryDate").toString())); } // validate the optional field ratepaydata.dueDate if (jsonObj.get("ratepaydata.dueDate") != null && !jsonObj.get("ratepaydata.dueDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.dueDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.dueDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.dueDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.dueDate").toString())); } // validate the optional field ratepaydata.invoiceDate if (jsonObj.get("ratepaydata.invoiceDate") != null && !jsonObj.get("ratepaydata.invoiceDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.invoiceDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.invoiceDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceDate").toString())); } // validate the optional field ratepaydata.invoiceId if (jsonObj.get("ratepaydata.invoiceId") != null && !jsonObj.get("ratepaydata.invoiceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.invoiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceId").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.invoiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java index 2cb856a59..e9858ad21 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRetry.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRetry.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRetry` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRetry` properties.", entry.getKey())); } } // validate the optional field retry.chainAttemptNumber if (jsonObj.get("retry.chainAttemptNumber") != null && !jsonObj.get("retry.chainAttemptNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retry.chainAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.chainAttemptNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `retry.chainAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.chainAttemptNumber").toString())); } // validate the optional field retry.orderAttemptNumber if (jsonObj.get("retry.orderAttemptNumber") != null && !jsonObj.get("retry.orderAttemptNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retry.orderAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.orderAttemptNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `retry.orderAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.orderAttemptNumber").toString())); } // validate the optional field retry.skipRetry if (jsonObj.get("retry.skipRetry") != null && !jsonObj.get("retry.skipRetry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retry.skipRetry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.skipRetry").toString())); + log.log(Level.WARNING, String.format("Expected the field `retry.skipRetry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.skipRetry").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java index d10bf700d..8ba87a82d 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -707,6 +709,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRisk.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -727,92 +733,92 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRisk.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRisk` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRisk` properties.", entry.getKey())); } } // validate the optional field riskdata.[customFieldName] if (jsonObj.get("riskdata.[customFieldName]") != null && !jsonObj.get("riskdata.[customFieldName]").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.[customFieldName]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.[customFieldName]").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.[customFieldName]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.[customFieldName]").toString())); } // validate the optional field riskdata.basket.item[itemNr].amountPerItem if (jsonObj.get("riskdata.basket.item[itemNr].amountPerItem") != null && !jsonObj.get("riskdata.basket.item[itemNr].amountPerItem").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].amountPerItem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].amountPerItem").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].amountPerItem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].amountPerItem").toString())); } // validate the optional field riskdata.basket.item[itemNr].brand if (jsonObj.get("riskdata.basket.item[itemNr].brand") != null && !jsonObj.get("riskdata.basket.item[itemNr].brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].brand").toString())); } // validate the optional field riskdata.basket.item[itemNr].category if (jsonObj.get("riskdata.basket.item[itemNr].category") != null && !jsonObj.get("riskdata.basket.item[itemNr].category").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].category").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].category").toString())); } // validate the optional field riskdata.basket.item[itemNr].color if (jsonObj.get("riskdata.basket.item[itemNr].color") != null && !jsonObj.get("riskdata.basket.item[itemNr].color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].color").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].color").toString())); } // validate the optional field riskdata.basket.item[itemNr].currency if (jsonObj.get("riskdata.basket.item[itemNr].currency") != null && !jsonObj.get("riskdata.basket.item[itemNr].currency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].currency").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].currency").toString())); } // validate the optional field riskdata.basket.item[itemNr].itemID if (jsonObj.get("riskdata.basket.item[itemNr].itemID") != null && !jsonObj.get("riskdata.basket.item[itemNr].itemID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].itemID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].itemID").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].itemID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].itemID").toString())); } // validate the optional field riskdata.basket.item[itemNr].manufacturer if (jsonObj.get("riskdata.basket.item[itemNr].manufacturer") != null && !jsonObj.get("riskdata.basket.item[itemNr].manufacturer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].manufacturer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].manufacturer").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].manufacturer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].manufacturer").toString())); } // validate the optional field riskdata.basket.item[itemNr].productTitle if (jsonObj.get("riskdata.basket.item[itemNr].productTitle") != null && !jsonObj.get("riskdata.basket.item[itemNr].productTitle").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].productTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].productTitle").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].productTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].productTitle").toString())); } // validate the optional field riskdata.basket.item[itemNr].quantity if (jsonObj.get("riskdata.basket.item[itemNr].quantity") != null && !jsonObj.get("riskdata.basket.item[itemNr].quantity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].quantity").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].quantity").toString())); } // validate the optional field riskdata.basket.item[itemNr].receiverEmail if (jsonObj.get("riskdata.basket.item[itemNr].receiverEmail") != null && !jsonObj.get("riskdata.basket.item[itemNr].receiverEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].receiverEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].receiverEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].receiverEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].receiverEmail").toString())); } // validate the optional field riskdata.basket.item[itemNr].size if (jsonObj.get("riskdata.basket.item[itemNr].size") != null && !jsonObj.get("riskdata.basket.item[itemNr].size").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].size").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].size").toString())); } // validate the optional field riskdata.basket.item[itemNr].sku if (jsonObj.get("riskdata.basket.item[itemNr].sku") != null && !jsonObj.get("riskdata.basket.item[itemNr].sku").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].sku").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].sku").toString())); } // validate the optional field riskdata.basket.item[itemNr].upc if (jsonObj.get("riskdata.basket.item[itemNr].upc") != null && !jsonObj.get("riskdata.basket.item[itemNr].upc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].upc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].upc").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].upc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].upc").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionCode if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionDiscountAmount if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionDiscountCurrency if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionDiscountPercentage if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionName if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName").toString())); } // validate the optional field riskdata.riskProfileReference if (jsonObj.get("riskdata.riskProfileReference") != null && !jsonObj.get("riskdata.riskProfileReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.riskProfileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.riskProfileReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.riskProfileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.riskProfileReference").toString())); } // validate the optional field riskdata.skipRisk if (jsonObj.get("riskdata.skipRisk") != null && !jsonObj.get("riskdata.skipRisk").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.skipRisk` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.skipRisk").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.skipRisk` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.skipRisk").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java index a9532558f..60477e892 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -533,6 +535,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRiskStandalone.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -553,68 +559,68 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRiskStandalone.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRiskStandalone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRiskStandalone` properties.", entry.getKey())); } } // validate the optional field PayPal.CountryCode if (jsonObj.get("PayPal.CountryCode") != null && !jsonObj.get("PayPal.CountryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.CountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.CountryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.CountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.CountryCode").toString())); } // validate the optional field PayPal.EmailId if (jsonObj.get("PayPal.EmailId") != null && !jsonObj.get("PayPal.EmailId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.EmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.EmailId").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.EmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.EmailId").toString())); } // validate the optional field PayPal.FirstName if (jsonObj.get("PayPal.FirstName") != null && !jsonObj.get("PayPal.FirstName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.FirstName").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.FirstName").toString())); } // validate the optional field PayPal.LastName if (jsonObj.get("PayPal.LastName") != null && !jsonObj.get("PayPal.LastName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.LastName").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.LastName").toString())); } // validate the optional field PayPal.PayerId if (jsonObj.get("PayPal.PayerId") != null && !jsonObj.get("PayPal.PayerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.PayerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.PayerId").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.PayerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.PayerId").toString())); } // validate the optional field PayPal.Phone if (jsonObj.get("PayPal.Phone") != null && !jsonObj.get("PayPal.Phone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.Phone").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.Phone").toString())); } // validate the optional field PayPal.ProtectionEligibility if (jsonObj.get("PayPal.ProtectionEligibility") != null && !jsonObj.get("PayPal.ProtectionEligibility").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.ProtectionEligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.ProtectionEligibility").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.ProtectionEligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.ProtectionEligibility").toString())); } // validate the optional field PayPal.TransactionId if (jsonObj.get("PayPal.TransactionId") != null && !jsonObj.get("PayPal.TransactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.TransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.TransactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.TransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.TransactionId").toString())); } // validate the optional field avsResultRaw if (jsonObj.get("avsResultRaw") != null && !jsonObj.get("avsResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); } // validate the optional field bin if (jsonObj.get("bin") != null && !jsonObj.get("bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); } // validate the optional field cvcResultRaw if (jsonObj.get("cvcResultRaw") != null && !jsonObj.get("cvcResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); } // validate the optional field riskToken if (jsonObj.get("riskToken") != null && !jsonObj.get("riskToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskToken").toString())); } // validate the optional field threeDAuthenticated if (jsonObj.get("threeDAuthenticated") != null && !jsonObj.get("threeDAuthenticated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); } // validate the optional field threeDOffered if (jsonObj.get("threeDOffered") != null && !jsonObj.get("threeDOffered").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); } // validate the optional field tokenDataType if (jsonObj.get("tokenDataType") != null && !jsonObj.get("tokenDataType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenDataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenDataType").toString())); + log.log(Level.WARNING, String.format("Expected the field `tokenDataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenDataType").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java index 729c36243..14fc7aba8 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -388,6 +390,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataSubMerchant.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -408,48 +414,48 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataSubMerchant.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataSubMerchant` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataSubMerchant` properties.", entry.getKey())); } } // validate the optional field subMerchant.numberOfSubSellers if (jsonObj.get("subMerchant.numberOfSubSellers") != null && !jsonObj.get("subMerchant.numberOfSubSellers").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.numberOfSubSellers` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.numberOfSubSellers").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.numberOfSubSellers` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.numberOfSubSellers").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].city if (jsonObj.get("subMerchant.subSeller[subSellerNr].city") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].city").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].city").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].city").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].country if (jsonObj.get("subMerchant.subSeller[subSellerNr].country") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].country").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].country").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].country").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].id if (jsonObj.get("subMerchant.subSeller[subSellerNr].id") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].id").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].id").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].mcc if (jsonObj.get("subMerchant.subSeller[subSellerNr].mcc") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].mcc").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].name if (jsonObj.get("subMerchant.subSeller[subSellerNr].name") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].name").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].name").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].postalCode if (jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].state if (jsonObj.get("subMerchant.subSeller[subSellerNr].state") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].state").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].state").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].state").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].street if (jsonObj.get("subMerchant.subSeller[subSellerNr].street") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].street").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].street").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].taxId if (jsonObj.get("subMerchant.subSeller[subSellerNr].taxId") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java index 2772e56ad..ba7097d8f 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -359,6 +361,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataTemporaryServices.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -379,44 +385,44 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataTemporaryServices.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataTemporaryServices` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataTemporaryServices` properties.", entry.getKey())); } } // validate the optional field enhancedSchemeData.customerReference if (jsonObj.get("enhancedSchemeData.customerReference") != null && !jsonObj.get("enhancedSchemeData.customerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); } // validate the optional field enhancedSchemeData.employeeName if (jsonObj.get("enhancedSchemeData.employeeName") != null && !jsonObj.get("enhancedSchemeData.employeeName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.employeeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.employeeName").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.employeeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.employeeName").toString())); } // validate the optional field enhancedSchemeData.jobDescription if (jsonObj.get("enhancedSchemeData.jobDescription") != null && !jsonObj.get("enhancedSchemeData.jobDescription").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.jobDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.jobDescription").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.jobDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.jobDescription").toString())); } // validate the optional field enhancedSchemeData.regularHoursRate if (jsonObj.get("enhancedSchemeData.regularHoursRate") != null && !jsonObj.get("enhancedSchemeData.regularHoursRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.regularHoursRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.regularHoursRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursRate").toString())); } // validate the optional field enhancedSchemeData.regularHoursWorked if (jsonObj.get("enhancedSchemeData.regularHoursWorked") != null && !jsonObj.get("enhancedSchemeData.regularHoursWorked").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.regularHoursWorked` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursWorked").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.regularHoursWorked` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursWorked").toString())); } // validate the optional field enhancedSchemeData.requestName if (jsonObj.get("enhancedSchemeData.requestName") != null && !jsonObj.get("enhancedSchemeData.requestName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.requestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.requestName").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.requestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.requestName").toString())); } // validate the optional field enhancedSchemeData.tempStartDate if (jsonObj.get("enhancedSchemeData.tempStartDate") != null && !jsonObj.get("enhancedSchemeData.tempStartDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.tempStartDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempStartDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.tempStartDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempStartDate").toString())); } // validate the optional field enhancedSchemeData.tempWeekEnding if (jsonObj.get("enhancedSchemeData.tempWeekEnding") != null && !jsonObj.get("enhancedSchemeData.tempWeekEnding").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.tempWeekEnding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempWeekEnding").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.tempWeekEnding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempWeekEnding").toString())); } // validate the optional field enhancedSchemeData.totalTaxAmount if (jsonObj.get("enhancedSchemeData.totalTaxAmount") != null && !jsonObj.get("enhancedSchemeData.totalTaxAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java b/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java index 236220651..52a85afea 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -272,6 +274,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataWallets.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -292,32 +298,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataWallets.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataWallets` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataWallets` properties.", entry.getKey())); } } // validate the optional field androidpay.token if (jsonObj.get("androidpay.token") != null && !jsonObj.get("androidpay.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `androidpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("androidpay.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `androidpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("androidpay.token").toString())); } // validate the optional field masterpass.transactionId if (jsonObj.get("masterpass.transactionId") != null && !jsonObj.get("masterpass.transactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `masterpass.transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masterpass.transactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `masterpass.transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masterpass.transactionId").toString())); } // validate the optional field payment.token if (jsonObj.get("payment.token") != null && !jsonObj.get("payment.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payment.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `payment.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment.token").toString())); } // validate the optional field paywithgoogle.token if (jsonObj.get("paywithgoogle.token") != null && !jsonObj.get("paywithgoogle.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paywithgoogle.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paywithgoogle.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `paywithgoogle.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paywithgoogle.token").toString())); } // validate the optional field samsungpay.token if (jsonObj.get("samsungpay.token") != null && !jsonObj.get("samsungpay.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `samsungpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("samsungpay.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `samsungpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("samsungpay.token").toString())); } // validate the optional field visacheckout.callId if (jsonObj.get("visacheckout.callId") != null && !jsonObj.get("visacheckout.callId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `visacheckout.callId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visacheckout.callId").toString())); + log.log(Level.WARNING, String.format("Expected the field `visacheckout.callId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visacheckout.callId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/Address.java b/src/main/java/com/adyen/model/checkout/Address.java index b1a4b96cf..ba29321ff 100644 --- a/src/main/java/com/adyen/model/checkout/Address.java +++ b/src/main/java/com/adyen/model/checkout/Address.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -277,6 +279,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("postalCode"); openapiRequiredFields.add("street"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -297,7 +303,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } @@ -309,27 +315,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 houseNumberOrName if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java index d9701e2b2..c12b66ab0 100644 --- a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -356,6 +358,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AfterpayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -376,7 +382,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AfterpayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AfterpayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AfterpayDetails` properties.", entry.getKey())); } } @@ -388,27 +394,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingAddress if (jsonObj.get("billingAddress") != null && !jsonObj.get("billingAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field deliveryAddress if (jsonObj.get("deliveryAddress") != null && !jsonObj.get("deliveryAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); } // validate the optional field personalDetails if (jsonObj.get("personalDetails") != null && !jsonObj.get("personalDetails").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").toString())); + log.log(Level.WARNING, String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/AmazonPayDetails.java b/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java index 6e80e597c..4c90bb81d 100644 --- a/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -230,6 +232,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AmazonPayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -250,16 +256,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AmazonPayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AmazonPayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AmazonPayDetails` properties.", entry.getKey())); } } // validate the optional field amazonPayToken if (jsonObj.get("amazonPayToken") != null && !jsonObj.get("amazonPayToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `amazonPayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amazonPayToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `amazonPayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amazonPayToken").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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/checkout/Amount.java b/src/main/java/com/adyen/model/checkout/Amount.java index 088c4dc4d..49dd69022 100644 --- a/src/main/java/com/adyen/model/checkout/Amount.java +++ b/src/main/java/com/adyen/model/checkout/Amount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java b/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java index 04d7415f6..abaf446da 100644 --- a/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AndroidPayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,12 +227,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AndroidPayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidPayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AndroidPayDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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/checkout/ApplePayDetails.java b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java index fef11b65c..cb64e0979 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -368,6 +370,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("applePayToken"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApplePayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -388,7 +394,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApplePayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApplePayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApplePayDetails` properties.", entry.getKey())); } } @@ -400,11 +406,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field applePayToken if (jsonObj.get("applePayToken") != null && !jsonObj.get("applePayToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `applePayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applePayToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `applePayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("applePayToken").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -415,11 +421,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/ApplePaySessionResponse.java b/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java index b8078ac1b..96cedd098 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("data"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApplePaySessionResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApplePaySessionResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApplePaySessionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApplePaySessionResponse` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field data if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + log.log(Level.WARNING, String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ApplicationInfo.java b/src/main/java/com/adyen/model/checkout/ApplicationInfo.java index 5b401633c..6fc42fa5b 100644 --- a/src/main/java/com/adyen/model/checkout/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ApplicationInfo.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -276,6 +278,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApplicationInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -296,7 +302,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApplicationInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApplicationInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApplicationInfo` properties.", entry.getKey())); } } // validate the optional field `adyenLibrary` diff --git a/src/main/java/com/adyen/model/checkout/AuthenticationData.java b/src/main/java/com/adyen/model/checkout/AuthenticationData.java index 6facf7dc1..6644ef57a 100644 --- a/src/main/java/com/adyen/model/checkout/AuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/AuthenticationData.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AuthenticationData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AuthenticationData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthenticationData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AuthenticationData` properties.", entry.getKey())); } } // ensure the field attemptAuthentication can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/checkout/Avs.java b/src/main/java/com/adyen/model/checkout/Avs.java index fd8160e26..05abbcb67 100644 --- a/src/main/java/com/adyen/model/checkout/Avs.java +++ b/src/main/java/com/adyen/model/checkout/Avs.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -205,6 +207,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Avs.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -225,7 +231,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Avs.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Avs` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Avs` properties.", entry.getKey())); } } // ensure the field enabled can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java index bb4c9c437..5a3f99ece 100644 --- a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -351,6 +353,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BacsDirectDebitDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -371,32 +377,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BacsDirectDebitDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BacsDirectDebitDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BacsDirectDebitDetails` properties.", entry.getKey())); } } // validate the optional field bankAccountNumber if (jsonObj.get("bankAccountNumber") != null && !jsonObj.get("bankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); } // validate the optional field bankLocationId if (jsonObj.get("bankLocationId") != null && !jsonObj.get("bankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/BankAccount.java b/src/main/java/com/adyen/model/checkout/BankAccount.java index ec9ecf454..417cd5c0f 100644 --- a/src/main/java/com/adyen/model/checkout/BankAccount.java +++ b/src/main/java/com/adyen/model/checkout/BankAccount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -359,6 +361,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -379,44 +385,44 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccount` properties.", entry.getKey())); } } // validate the optional field bankAccountNumber if (jsonObj.get("bankAccountNumber") != null && !jsonObj.get("bankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").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())); + log.log(Level.WARNING, 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 bankLocationId if (jsonObj.get("bankLocationId") != null && !jsonObj.get("bankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/BillDeskDetails.java b/src/main/java/com/adyen/model/checkout/BillDeskDetails.java index 062976b6f..16b112e46 100644 --- a/src/main/java/com/adyen/model/checkout/BillDeskDetails.java +++ b/src/main/java/com/adyen/model/checkout/BillDeskDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -238,6 +240,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuer"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BillDeskDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -258,7 +264,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BillDeskDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BillDeskDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BillDeskDetails` properties.", entry.getKey())); } } @@ -270,11 +276,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); } // 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/checkout/BlikDetails.java b/src/main/java/com/adyen/model/checkout/BlikDetails.java index cc16d8f7f..21f8c29c2 100644 --- a/src/main/java/com/adyen/model/checkout/BlikDetails.java +++ b/src/main/java/com/adyen/model/checkout/BlikDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -293,6 +295,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BlikDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -313,24 +319,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BlikDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BlikDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BlikDetails` properties.", entry.getKey())); } } // validate the optional field blikCode if (jsonObj.get("blikCode") != null && !jsonObj.get("blikCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `blikCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blikCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `blikCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("blikCode").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/BrowserInfo.java b/src/main/java/com/adyen/model/checkout/BrowserInfo.java index 1a4f25eed..e4411476e 100644 --- a/src/main/java/com/adyen/model/checkout/BrowserInfo.java +++ b/src/main/java/com/adyen/model/checkout/BrowserInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -367,6 +369,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timeZoneOffset"); openapiRequiredFields.add("userAgent"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BrowserInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -387,7 +393,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BrowserInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BrowserInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BrowserInfo` properties.", entry.getKey())); } } @@ -399,15 +405,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field acceptHeader if (jsonObj.get("acceptHeader") != null && !jsonObj.get("acceptHeader").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acceptHeader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptHeader").toString())); + log.log(Level.WARNING, String.format("Expected the field `acceptHeader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptHeader").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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } // validate the optional field userAgent if (jsonObj.get("userAgent") != null && !jsonObj.get("userAgent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); + log.log(Level.WARNING, String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/Card.java b/src/main/java/com/adyen/model/checkout/Card.java index 0a2112b34..e9a67b6fa 100644 --- a/src/main/java/com/adyen/model/checkout/Card.java +++ b/src/main/java/com/adyen/model/checkout/Card.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -330,6 +332,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Card.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -350,40 +356,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Card.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Card` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); } // validate the optional field issueNumber if (jsonObj.get("issueNumber") != null && !jsonObj.get("issueNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // validate the optional field startMonth if (jsonObj.get("startMonth") != null && !jsonObj.get("startMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); } // validate the optional field startYear if (jsonObj.get("startYear") != null && !jsonObj.get("startYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CardBrandDetails.java b/src/main/java/com/adyen/model/checkout/CardBrandDetails.java index 35444ef0f..63e6661b6 100644 --- a/src/main/java/com/adyen/model/checkout/CardBrandDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardBrandDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardBrandDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,12 +182,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardBrandDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardBrandDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardBrandDetails` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CardDetails.java b/src/main/java/com/adyen/model/checkout/CardDetails.java index 37dd3ddb8..b42508d80 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -178,6 +180,12 @@ public enum TypeEnum { GIFTCARD("giftcard"), + MEALVOUCHER_FR_GROUPEUP("mealVoucher_FR_groupeup"), + + MEALVOUCHER_FR_NATIXIS("mealVoucher_FR_natixis"), + + MEALVOUCHER_FR_SODEXO("mealVoucher_FR_sodexo"), + ALLIANCEDATA("alliancedata"), CARD("card"); @@ -757,6 +765,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -777,48 +789,48 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardDetails` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field cupsecureplus.smscode if (jsonObj.get("cupsecureplus.smscode") != null && !jsonObj.get("cupsecureplus.smscode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cupsecureplus.smscode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cupsecureplus.smscode").toString())); + log.log(Level.WARNING, String.format("Expected the field `cupsecureplus.smscode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cupsecureplus.smscode").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())); + log.log(Level.WARNING, 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 encryptedCardNumber if (jsonObj.get("encryptedCardNumber") != null && !jsonObj.get("encryptedCardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedCardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedCardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedCardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedCardNumber").toString())); } // validate the optional field encryptedExpiryMonth if (jsonObj.get("encryptedExpiryMonth") != null && !jsonObj.get("encryptedExpiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedExpiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedExpiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedExpiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedExpiryMonth").toString())); } // validate the optional field encryptedExpiryYear if (jsonObj.get("encryptedExpiryYear") != null && !jsonObj.get("encryptedExpiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedExpiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedExpiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedExpiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedExpiryYear").toString())); } // validate the optional field encryptedSecurityCode if (jsonObj.get("encryptedSecurityCode") != null && !jsonObj.get("encryptedSecurityCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedSecurityCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedSecurityCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedSecurityCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedSecurityCode").toString())); } // validate the optional field expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -829,31 +841,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); } // validate the optional field networkPaymentReference if (jsonObj.get("networkPaymentReference") != null && !jsonObj.get("networkPaymentReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkPaymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkPaymentReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkPaymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkPaymentReference").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").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())); + log.log(Level.WARNING, 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 shopperNotificationReference if (jsonObj.get("shopperNotificationReference") != null && !jsonObj.get("shopperNotificationReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); } // validate the optional field storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // validate the optional field threeDS2SdkVersion if (jsonObj.get("threeDS2SdkVersion") != null && !jsonObj.get("threeDS2SdkVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDS2SdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDS2SdkVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDS2SdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDS2SdkVersion").toString())); } // 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/checkout/CardDetailsRequest.java b/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java index 7e61ee0d6..149f8c9b3 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -255,6 +257,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("cardNumber"); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardDetailsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -275,7 +281,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardDetailsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardDetailsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardDetailsRequest` properties.", entry.getKey())); } } @@ -287,23 +293,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cardNumber if (jsonObj.get("cardNumber") != null && !jsonObj.get("cardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").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())); + log.log(Level.WARNING, 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 encryptedCardNumber if (jsonObj.get("encryptedCardNumber") != null && !jsonObj.get("encryptedCardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `encryptedCardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedCardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `encryptedCardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("encryptedCardNumber").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())); + log.log(Level.WARNING, String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); } // ensure the json data is an array if (jsonObj.get("supportedBrands") != null && !jsonObj.get("supportedBrands").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `supportedBrands` to be an array in the JSON string but got `%s`", jsonObj.get("supportedBrands").toString())); + log.log(Level.WARNING, String.format("Expected the field `supportedBrands` to be an array in the JSON string but got `%s`", jsonObj.get("supportedBrands").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java index efd6f2f9c..e1fa4ee9c 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardDetailsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardDetailsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardDetailsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardDetailsResponse` properties.", entry.getKey())); } } JsonArray jsonArraybrands = jsonObj.getAsJsonArray("brands"); diff --git a/src/main/java/com/adyen/model/checkout/CellulantDetails.java b/src/main/java/com/adyen/model/checkout/CellulantDetails.java index 699f94e12..9d0ca18d6 100644 --- a/src/main/java/com/adyen/model/checkout/CellulantDetails.java +++ b/src/main/java/com/adyen/model/checkout/CellulantDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -230,6 +232,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CellulantDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -250,16 +256,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CellulantDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CellulantDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CellulantDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); } // 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/checkout/CheckoutAwaitAction.java b/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java index dca1f2379..0c325186e 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -260,6 +262,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutAwaitAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -280,7 +286,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutAwaitAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutAwaitAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutAwaitAction` properties.", entry.getKey())); } } @@ -292,11 +298,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field paymentData if (jsonObj.get("paymentData") != null && !jsonObj.get("paymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -307,7 +313,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java index 114cd5575..994450d00 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckRequest.java @@ -58,6 +58,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1536,6 +1538,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("paymentMethod"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutBalanceCheckRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1556,7 +1562,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutBalanceCheckRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutBalanceCheckRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutBalanceCheckRequest` properties.", entry.getKey())); } } @@ -1600,7 +1606,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceFingerprint if (jsonObj.get("deviceFingerprint") != null && !jsonObj.get("deviceFingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); } // validate the optional field `installments` if (jsonObj.getAsJsonObject("installments") != null) { @@ -1608,15 +1614,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `merchantRiskIndicator` if (jsonObj.getAsJsonObject("merchantRiskIndicator") != null) { @@ -1624,7 +1630,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -1639,27 +1645,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedBrand if (jsonObj.get("selectedBrand") != null && !jsonObj.get("selectedBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); } // validate the optional field selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field sessionId if (jsonObj.get("sessionId") != null && !jsonObj.get("sessionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -1670,7 +1676,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -1678,15 +1684,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -1702,11 +1708,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field `threeDS2RequestData` if (jsonObj.getAsJsonObject("threeDS2RequestData") != null) { @@ -1714,7 +1720,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field totalsGroup if (jsonObj.get("totalsGroup") != null && !jsonObj.get("totalsGroup").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); + log.log(Level.WARNING, String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckResponse.java index 45ff4ac14..7a0ddc0f2 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBalanceCheckResponse.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -365,6 +367,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("balance"); openapiRequiredFields.add("resultCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutBalanceCheckResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -385,7 +391,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutBalanceCheckResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutBalanceCheckResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutBalanceCheckResponse` properties.", entry.getKey())); } } @@ -405,11 +411,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java index 648f7b6cd..d99ded30f 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("order"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutCancelOrderRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutCancelOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutCancelOrderRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutCancelOrderRequest` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `order` if (jsonObj.getAsJsonObject("order") != null) { diff --git a/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderResponse.java index 5209f3531..78415cb0e 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutCancelOrderResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("resultCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutCancelOrderResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutCancelOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutCancelOrderResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutCancelOrderResponse` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } // ensure the field resultCode can be parsed to an enum value if (jsonObj.get("resultCode") != null) { diff --git a/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderRequest.java index 4bb344db9..f8d1f8710 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -218,6 +220,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutCreateOrderRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -238,7 +244,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutCreateOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutCreateOrderRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutCreateOrderRequest` properties.", entry.getKey())); } } @@ -254,15 +260,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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/checkout/CheckoutCreateOrderResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderResponse.java index 6094c2cc2..01933e970 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutCreateOrderResponse.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -451,6 +453,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("remainingAmount"); openapiRequiredFields.add("resultCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutCreateOrderResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -471,7 +477,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutCreateOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutCreateOrderResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutCreateOrderResponse` properties.", entry.getKey())); } } @@ -487,7 +493,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); } // validate the optional field `fraudResult` if (jsonObj.getAsJsonObject("fraudResult") != null) { @@ -495,19 +501,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderData if (jsonObj.get("orderData") != null && !jsonObj.get("orderData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderData").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderData").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); } // validate the optional field `remainingAmount` if (jsonObj.getAsJsonObject("remainingAmount") != null) { diff --git a/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java b/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java index f66ba6067..99ef90656 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -329,6 +331,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutNativeRedirectAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -349,7 +355,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutNativeRedirectAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutNativeRedirectAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutNativeRedirectAction` properties.", entry.getKey())); } } @@ -361,15 +367,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field method if (jsonObj.get("method") != null && !jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); + log.log(Level.WARNING, String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); } // validate the optional field nativeRedirectData if (jsonObj.get("nativeRedirectData") != null && !jsonObj.get("nativeRedirectData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nativeRedirectData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nativeRedirectData").toString())); + log.log(Level.WARNING, String.format("Expected the field `nativeRedirectData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nativeRedirectData").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -380,7 +386,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java index b9ee82140..35832bd72 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -274,6 +276,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("pspReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutOrderResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -294,7 +300,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutOrderResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutOrderResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutOrderResponse` properties.", entry.getKey())); } } @@ -310,19 +316,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); } // validate the optional field orderData if (jsonObj.get("orderData") != null && !jsonObj.get("orderData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderData").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderData").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 `remainingAmount` if (jsonObj.getAsJsonObject("remainingAmount") != null) { diff --git a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java index 781f3a7d7..8d1118e51 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java @@ -1908,6 +1908,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with AchDetails try { + Logger.getLogger(AchDetails.class.getName()).setLevel(Level.OFF); AchDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1916,6 +1917,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with AfterpayDetails try { + Logger.getLogger(AfterpayDetails.class.getName()).setLevel(Level.OFF); AfterpayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1924,6 +1926,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with AmazonPayDetails try { + Logger.getLogger(AmazonPayDetails.class.getName()).setLevel(Level.OFF); AmazonPayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1932,6 +1935,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with AndroidPayDetails try { + Logger.getLogger(AndroidPayDetails.class.getName()).setLevel(Level.OFF); AndroidPayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1940,6 +1944,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with ApplePayDetails try { + Logger.getLogger(ApplePayDetails.class.getName()).setLevel(Level.OFF); ApplePayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1948,6 +1953,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with BacsDirectDebitDetails try { + Logger.getLogger(BacsDirectDebitDetails.class.getName()).setLevel(Level.OFF); BacsDirectDebitDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1956,6 +1962,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with BillDeskDetails try { + Logger.getLogger(BillDeskDetails.class.getName()).setLevel(Level.OFF); BillDeskDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1964,6 +1971,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with BlikDetails try { + Logger.getLogger(BlikDetails.class.getName()).setLevel(Level.OFF); BlikDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1972,6 +1980,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CardDetails try { + Logger.getLogger(CardDetails.class.getName()).setLevel(Level.OFF); CardDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1980,6 +1989,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CellulantDetails try { + Logger.getLogger(CellulantDetails.class.getName()).setLevel(Level.OFF); CellulantDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1988,6 +1998,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with DokuDetails try { + Logger.getLogger(DokuDetails.class.getName()).setLevel(Level.OFF); DokuDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -1996,6 +2007,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with DotpayDetails try { + Logger.getLogger(DotpayDetails.class.getName()).setLevel(Level.OFF); DotpayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2004,6 +2016,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with DragonpayDetails try { + Logger.getLogger(DragonpayDetails.class.getName()).setLevel(Level.OFF); DragonpayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2012,6 +2025,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with EcontextVoucherDetails try { + Logger.getLogger(EcontextVoucherDetails.class.getName()).setLevel(Level.OFF); EcontextVoucherDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2020,6 +2034,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with GenericIssuerPaymentMethodDetails try { + Logger.getLogger(GenericIssuerPaymentMethodDetails.class.getName()).setLevel(Level.OFF); GenericIssuerPaymentMethodDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2028,6 +2043,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with GiropayDetails try { + Logger.getLogger(GiropayDetails.class.getName()).setLevel(Level.OFF); GiropayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2036,6 +2052,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with GooglePayDetails try { + Logger.getLogger(GooglePayDetails.class.getName()).setLevel(Level.OFF); GooglePayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2044,6 +2061,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with IdealDetails try { + Logger.getLogger(IdealDetails.class.getName()).setLevel(Level.OFF); IdealDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2052,6 +2070,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with KlarnaDetails try { + Logger.getLogger(KlarnaDetails.class.getName()).setLevel(Level.OFF); KlarnaDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2060,6 +2079,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with MasterpassDetails try { + Logger.getLogger(MasterpassDetails.class.getName()).setLevel(Level.OFF); MasterpassDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2068,6 +2088,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with MbwayDetails try { + Logger.getLogger(MbwayDetails.class.getName()).setLevel(Level.OFF); MbwayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2076,6 +2097,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with MobilePayDetails try { + Logger.getLogger(MobilePayDetails.class.getName()).setLevel(Level.OFF); MobilePayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2084,6 +2106,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with MolPayDetails try { + Logger.getLogger(MolPayDetails.class.getName()).setLevel(Level.OFF); MolPayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2092,6 +2115,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with OpenInvoiceDetails try { + Logger.getLogger(OpenInvoiceDetails.class.getName()).setLevel(Level.OFF); OpenInvoiceDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2100,6 +2124,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PayPalDetails try { + Logger.getLogger(PayPalDetails.class.getName()).setLevel(Level.OFF); PayPalDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2108,6 +2133,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PayUUpiDetails try { + Logger.getLogger(PayUUpiDetails.class.getName()).setLevel(Level.OFF); PayUUpiDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2116,6 +2142,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PayWithGoogleDetails try { + Logger.getLogger(PayWithGoogleDetails.class.getName()).setLevel(Level.OFF); PayWithGoogleDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2124,6 +2151,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PaymentDetails try { + Logger.getLogger(PaymentDetails.class.getName()).setLevel(Level.OFF); PaymentDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2132,6 +2160,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with RatepayDetails try { + Logger.getLogger(RatepayDetails.class.getName()).setLevel(Level.OFF); RatepayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2140,6 +2169,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SamsungPayDetails try { + Logger.getLogger(SamsungPayDetails.class.getName()).setLevel(Level.OFF); SamsungPayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2148,6 +2178,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SepaDirectDebitDetails try { + Logger.getLogger(SepaDirectDebitDetails.class.getName()).setLevel(Level.OFF); SepaDirectDebitDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2156,6 +2187,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with StoredPaymentMethodDetails try { + Logger.getLogger(StoredPaymentMethodDetails.class.getName()).setLevel(Level.OFF); StoredPaymentMethodDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2164,6 +2196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UpiCollectDetails try { + Logger.getLogger(UpiCollectDetails.class.getName()).setLevel(Level.OFF); UpiCollectDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2172,6 +2205,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UpiIntentDetails try { + Logger.getLogger(UpiIntentDetails.class.getName()).setLevel(Level.OFF); UpiIntentDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2180,6 +2214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with VippsDetails try { + Logger.getLogger(VippsDetails.class.getName()).setLevel(Level.OFF); VippsDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2188,6 +2223,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with VisaCheckoutDetails try { + Logger.getLogger(VisaCheckoutDetails.class.getName()).setLevel(Level.OFF); VisaCheckoutDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2196,6 +2232,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with WeChatPayDetails try { + Logger.getLogger(WeChatPayDetails.class.getName()).setLevel(Level.OFF); WeChatPayDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2204,6 +2241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with WeChatPayMiniProgramDetails try { + Logger.getLogger(WeChatPayMiniProgramDetails.class.getName()).setLevel(Level.OFF); WeChatPayMiniProgramDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -2212,6 +2250,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with ZipDetails try { + Logger.getLogger(ZipDetails.class.getName()).setLevel(Level.OFF); ZipDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java b/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java index c0827cc29..7e922685b 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -318,6 +320,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutQrCodeAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -338,7 +344,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutQrCodeAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutQrCodeAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutQrCodeAction` properties.", entry.getKey())); } } @@ -350,19 +356,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); } // validate the optional field paymentData if (jsonObj.get("paymentData") != null && !jsonObj.get("paymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); } // validate the optional field qrCodeData if (jsonObj.get("qrCodeData") != null && !jsonObj.get("qrCodeData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `qrCodeData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qrCodeData").toString())); + log.log(Level.WARNING, String.format("Expected the field `qrCodeData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qrCodeData").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java b/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java index 4b69cd93f..1d01394ba 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -300,6 +302,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutRedirectAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -320,7 +326,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutRedirectAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutRedirectAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutRedirectAction` properties.", entry.getKey())); } } @@ -332,11 +338,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field method if (jsonObj.get("method") != null && !jsonObj.get("method").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); + log.log(Level.WARNING, String.format("Expected the field `method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("method").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -347,7 +353,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java b/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java index 59c75248c..84781d1fa 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -302,6 +304,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutSDKAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -322,7 +328,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutSDKAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutSDKAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutSDKAction` properties.", entry.getKey())); } } @@ -334,11 +340,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field paymentData if (jsonObj.get("paymentData") != null && !jsonObj.get("paymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -349,7 +355,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java index 490b05caf..3313ca2bb 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -250,6 +252,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutSessionInstallmentOption.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -270,16 +276,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutSessionInstallmentOption.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutSessionInstallmentOption` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutSessionInstallmentOption` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("plans") != null && !jsonObj.get("plans").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `plans` to be an array in the JSON string but got `%s`", jsonObj.get("plans").toString())); + log.log(Level.WARNING, String.format("Expected the field `plans` to be an array in the JSON string but got `%s`", jsonObj.get("plans").toString())); } // ensure the json data is an array if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + log.log(Level.WARNING, String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java b/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java index e2204da7f..55d713f09 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -347,6 +349,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutThreeDS2Action.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -367,7 +373,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutThreeDS2Action.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutThreeDS2Action` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutThreeDS2Action` properties.", entry.getKey())); } } @@ -379,23 +385,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field authorisationToken if (jsonObj.get("authorisationToken") != null && !jsonObj.get("authorisationToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationToken").toString())); } // validate the optional field paymentData if (jsonObj.get("paymentData") != null && !jsonObj.get("paymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); } // validate the optional field subtype if (jsonObj.get("subtype") != null && !jsonObj.get("subtype").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subtype` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subtype").toString())); + log.log(Level.WARNING, String.format("Expected the field `subtype` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subtype").toString())); } // validate the optional field token if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + log.log(Level.WARNING, String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -406,7 +412,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutUtilityRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutUtilityRequest.java index 779f60372..2669905e4 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutUtilityRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutUtilityRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -135,6 +137,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("originDomains"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutUtilityRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -155,7 +161,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutUtilityRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutUtilityRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutUtilityRequest` properties.", entry.getKey())); } } @@ -167,7 +173,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("originDomains") != null && !jsonObj.get("originDomains").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `originDomains` to be an array in the JSON string but got `%s`", jsonObj.get("originDomains").toString())); + log.log(Level.WARNING, String.format("Expected the field `originDomains` to be an array in the JSON string but got `%s`", jsonObj.get("originDomains").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutUtilityResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutUtilityResponse.java index dde5f0fb5..da610ce5b 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutUtilityResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutUtilityResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutUtilityResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutUtilityResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutUtilityResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutUtilityResponse` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java b/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java index 83c6cb615..fa6729e98 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -725,6 +727,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CheckoutVoucherAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -745,7 +751,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CheckoutVoucherAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CheckoutVoucherAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CheckoutVoucherAction` properties.", entry.getKey())); } } @@ -757,23 +763,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field alternativeReference if (jsonObj.get("alternativeReference") != null && !jsonObj.get("alternativeReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alternativeReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alternativeReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `alternativeReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alternativeReference").toString())); } // validate the optional field collectionInstitutionNumber if (jsonObj.get("collectionInstitutionNumber") != null && !jsonObj.get("collectionInstitutionNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `collectionInstitutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collectionInstitutionNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `collectionInstitutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("collectionInstitutionNumber").toString())); } // validate the optional field downloadUrl if (jsonObj.get("downloadUrl") != null && !jsonObj.get("downloadUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `downloadUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `downloadUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadUrl").toString())); } // validate the optional field entity if (jsonObj.get("entity") != null && !jsonObj.get("entity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); + log.log(Level.WARNING, String.format("Expected the field `entity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entity").toString())); } // validate the optional field expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); } // validate the optional field `initialAmount` if (jsonObj.getAsJsonObject("initialAmount") != null) { @@ -781,43 +787,43 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field instructionsUrl if (jsonObj.get("instructionsUrl") != null && !jsonObj.get("instructionsUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `instructionsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instructionsUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `instructionsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instructionsUrl").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); } // validate the optional field maskedTelephoneNumber if (jsonObj.get("maskedTelephoneNumber") != null && !jsonObj.get("maskedTelephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `maskedTelephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskedTelephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `maskedTelephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("maskedTelephoneNumber").toString())); } // validate the optional field merchantName if (jsonObj.get("merchantName") != null && !jsonObj.get("merchantName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantName").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantName").toString())); } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field paymentData if (jsonObj.get("paymentData") != null && !jsonObj.get("paymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); } // validate the optional field paymentMethodType if (jsonObj.get("paymentMethodType") != null && !jsonObj.get("paymentMethodType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodType").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())); + log.log(Level.WARNING, 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 shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperName if (jsonObj.get("shopperName") != null && !jsonObj.get("shopperName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperName").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperName").toString())); } // validate the optional field `surcharge` if (jsonObj.getAsJsonObject("surcharge") != null) { @@ -836,7 +842,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CommonField.java b/src/main/java/com/adyen/model/checkout/CommonField.java index 99c47c352..4aa811239 100644 --- a/src/main/java/com/adyen/model/checkout/CommonField.java +++ b/src/main/java/com/adyen/model/checkout/CommonField.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CommonField.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CommonField.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommonField` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CommonField` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field version if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + log.log(Level.WARNING, String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/Company.java b/src/main/java/com/adyen/model/checkout/Company.java index b4d100411..0dd40c5e6 100644 --- a/src/main/java/com/adyen/model/checkout/Company.java +++ b/src/main/java/com/adyen/model/checkout/Company.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -272,6 +274,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Company.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -292,32 +298,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Company.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Company` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Company` properties.", entry.getKey())); } } // validate the optional field homepage if (jsonObj.get("homepage") != null && !jsonObj.get("homepage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `homepage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("homepage").toString())); + log.log(Level.WARNING, String.format("Expected the field `homepage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("homepage").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field registrationNumber if (jsonObj.get("registrationNumber") != null && !jsonObj.get("registrationNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `registrationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registrationNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `registrationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registrationNumber").toString())); } // validate the optional field registryLocation if (jsonObj.get("registryLocation") != null && !jsonObj.get("registryLocation").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `registryLocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registryLocation").toString())); + log.log(Level.WARNING, String.format("Expected the field `registryLocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registryLocation").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CreateApplePaySessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateApplePaySessionRequest.java index 0ff0bcbf7..57a12d09e 100644 --- a/src/main/java/com/adyen/model/checkout/CreateApplePaySessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateApplePaySessionRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("domainName"); openapiRequiredFields.add("merchantIdentifier"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateApplePaySessionRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateApplePaySessionRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateApplePaySessionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateApplePaySessionRequest` properties.", entry.getKey())); } } @@ -220,15 +226,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field displayName if (jsonObj.get("displayName") != null && !jsonObj.get("displayName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); + log.log(Level.WARNING, String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); } // validate the optional field domainName if (jsonObj.get("domainName") != null && !jsonObj.get("domainName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `domainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainName").toString())); + log.log(Level.WARNING, String.format("Expected the field `domainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domainName").toString())); } // validate the optional field merchantIdentifier if (jsonObj.get("merchantIdentifier") != null && !jsonObj.get("merchantIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantIdentifier").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantIdentifier").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index 31adea4e5..b7473aa05 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -61,6 +61,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1584,10 +1586,10 @@ public CreateCheckoutSessionRequest addSplitsItem(Split splitsItem) { } /** - * An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + * An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * @return splits **/ - @ApiModelProperty(value = "An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).") + @ApiModelProperty(value = "An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).") public List getSplits() { return splits; @@ -1948,6 +1950,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("returnUrl"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCheckoutSessionRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1968,7 +1974,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCheckoutSessionRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCheckoutSessionRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCheckoutSessionRequest` properties.", entry.getKey())); } } @@ -1988,7 +1994,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -2008,7 +2014,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("blockedPaymentMethods") != null && !jsonObj.get("blockedPaymentMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); + log.log(Level.WARNING, String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); } // ensure the field channel can be parsed to an enum value if (jsonObj.get("channel") != null) { @@ -2023,7 +2029,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `deliveryAddress` if (jsonObj.getAsJsonObject("deliveryAddress") != null) { @@ -2055,15 +2061,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `mpiData` if (jsonObj.getAsJsonObject("mpiData") != null) { @@ -2071,11 +2077,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2086,19 +2092,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field redirectFromIssuerMethod if (jsonObj.get("redirectFromIssuerMethod") != null && !jsonObj.get("redirectFromIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); } // validate the optional field redirectToIssuerMethod if (jsonObj.get("redirectToIssuerMethod") != null && !jsonObj.get("redirectToIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").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())); + log.log(Level.WARNING, 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 returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -2106,11 +2112,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -2121,7 +2127,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -2129,15 +2135,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -2153,7 +2159,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } // ensure the field storePaymentMethodMode can be parsed to an enum value if (jsonObj.get("storePaymentMethodMode") != null) { @@ -2164,7 +2170,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index bf41c447d..fdd0fc8e6 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -61,6 +61,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1708,10 +1710,10 @@ public CreateCheckoutSessionResponse addSplitsItem(Split splitsItem) { } /** - * An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). + * An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * @return splits **/ - @ApiModelProperty(value = "An array of objects specifying how the payment should be split when using [Adyen for Platforms](https://docs.adyen.com/platforms/processing-payments#providing-split-information) or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).") + @ApiModelProperty(value = "An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).") public List getSplits() { return splits; @@ -2083,6 +2085,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("returnUrl"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCheckoutSessionResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -2103,7 +2109,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCheckoutSessionResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCheckoutSessionResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCheckoutSessionResponse` properties.", entry.getKey())); } } @@ -2123,7 +2129,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -2143,7 +2149,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("blockedPaymentMethods") != null && !jsonObj.get("blockedPaymentMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); + log.log(Level.WARNING, String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); } // ensure the field channel can be parsed to an enum value if (jsonObj.get("channel") != null) { @@ -2158,7 +2164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `deliveryAddress` if (jsonObj.getAsJsonObject("deliveryAddress") != null) { @@ -2174,7 +2180,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } JsonArray jsonArraylineItems = jsonObj.getAsJsonArray("lineItems"); if (jsonArraylineItems != null) { @@ -2194,15 +2200,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // ensure the field mode can be parsed to an enum value if (jsonObj.get("mode") != null) { @@ -2217,11 +2223,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2232,19 +2238,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field redirectFromIssuerMethod if (jsonObj.get("redirectFromIssuerMethod") != null && !jsonObj.get("redirectFromIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); } // validate the optional field redirectToIssuerMethod if (jsonObj.get("redirectToIssuerMethod") != null && !jsonObj.get("redirectToIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").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())); + log.log(Level.WARNING, 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 returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -2252,15 +2258,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field sessionData if (jsonObj.get("sessionData") != null && !jsonObj.get("sessionData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionData").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionData").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -2271,7 +2277,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -2279,15 +2285,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -2303,7 +2309,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } // ensure the field storePaymentMethodMode can be parsed to an enum value if (jsonObj.get("storePaymentMethodMode") != null) { @@ -2314,7 +2320,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java index ba5bdf44e..8473f3dcf 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentAmountUpdateRequest.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -306,6 +308,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("amount"); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePaymentAmountUpdateRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -326,7 +332,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePaymentAmountUpdateRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentAmountUpdateRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentAmountUpdateRequest` properties.", entry.getKey())); } } @@ -349,11 +355,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentCancelRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentCancelRequest.java index f1c0fda97..662d942d1 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentCancelRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentCancelRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePaymentCancelRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePaymentCancelRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentCancelRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentCancelRequest` properties.", entry.getKey())); } } @@ -189,11 +195,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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/checkout/CreatePaymentCaptureRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java index 38667ec44..e4ec2e8d3 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentCaptureRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -266,6 +268,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("amount"); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePaymentCaptureRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -286,7 +292,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePaymentCaptureRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentCaptureRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentCaptureRequest` properties.", entry.getKey())); } } @@ -314,11 +320,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java index 8bac7c492..45dab7a20 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentLinkRequest.java @@ -54,6 +54,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1157,10 +1159,10 @@ public CreatePaymentLinkRequest addSplitsItem(Split splitsItem) { } /** - * An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * @return splits **/ - @ApiModelProperty(value = "An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information).") + @ApiModelProperty(value = "An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).") public List getSplits() { return splits; @@ -1424,6 +1426,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePaymentLinkRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1444,7 +1450,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePaymentLinkRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentLinkRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentLinkRequest` properties.", entry.getKey())); } } @@ -1456,7 +1462,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -1472,11 +1478,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("blockedPaymentMethods") != null && !jsonObj.get("blockedPaymentMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); + log.log(Level.WARNING, String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").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())); + log.log(Level.WARNING, 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 `deliveryAddress` if (jsonObj.getAsJsonObject("deliveryAddress") != null) { @@ -1484,11 +1490,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); } JsonArray jsonArraylineItems = jsonObj.getAsJsonArray("lineItems"); if (jsonArraylineItems != null) { @@ -1504,15 +1510,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -1523,15 +1529,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } // ensure the json data is an array if (jsonObj.get("requiredShopperFields") != null && !jsonObj.get("requiredShopperFields").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `requiredShopperFields` to be an array in the JSON string but got `%s`", jsonObj.get("requiredShopperFields").toString())); + log.log(Level.WARNING, String.format("Expected the field `requiredShopperFields` to be an array in the JSON string but got `%s`", jsonObj.get("requiredShopperFields").toString())); } // validate the optional field returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -1539,11 +1545,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -1551,15 +1557,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -1575,7 +1581,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } // ensure the field storePaymentMethodMode can be parsed to an enum value if (jsonObj.get("storePaymentMethodMode") != null) { @@ -1586,11 +1592,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field themeId if (jsonObj.get("themeId") != null && !jsonObj.get("themeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `themeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("themeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `themeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("themeId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java index 9dbe36723..8ae8a600a 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentRefundRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -348,6 +350,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("amount"); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePaymentRefundRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -368,7 +374,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePaymentRefundRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentRefundRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentRefundRequest` properties.", entry.getKey())); } } @@ -396,7 +402,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); } // ensure the field merchantRefundReason can be parsed to an enum value if (jsonObj.get("merchantRefundReason") != null) { @@ -407,7 +413,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { diff --git a/src/main/java/com/adyen/model/checkout/CreatePaymentReversalRequest.java b/src/main/java/com/adyen/model/checkout/CreatePaymentReversalRequest.java index 072f05947..4d78dbf43 100644 --- a/src/main/java/com/adyen/model/checkout/CreatePaymentReversalRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreatePaymentReversalRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePaymentReversalRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePaymentReversalRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentReversalRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePaymentReversalRequest` properties.", entry.getKey())); } } @@ -189,11 +195,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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/checkout/CreateStandalonePaymentCancelRequest.java b/src/main/java/com/adyen/model/checkout/CreateStandalonePaymentCancelRequest.java index 7ec555502..6fbb527d4 100644 --- a/src/main/java/com/adyen/model/checkout/CreateStandalonePaymentCancelRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateStandalonePaymentCancelRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("paymentReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateStandalonePaymentCancelRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateStandalonePaymentCancelRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateStandalonePaymentCancelRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateStandalonePaymentCancelRequest` properties.", entry.getKey())); } } @@ -219,15 +225,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 paymentReference if (jsonObj.get("paymentReference") != null && !jsonObj.get("paymentReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentReference").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())); + log.log(Level.WARNING, 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/checkout/DetailsRequest.java b/src/main/java/com/adyen/model/checkout/DetailsRequest.java index c216ec83b..8ba4abfb9 100644 --- a/src/main/java/com/adyen/model/checkout/DetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/DetailsRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -222,6 +224,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("details"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DetailsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -242,7 +248,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DetailsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DetailsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DetailsRequest` properties.", entry.getKey())); } } @@ -262,7 +268,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field paymentData if (jsonObj.get("paymentData") != null && !jsonObj.get("paymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentData").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java b/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java index 2375e668b..45e3104d3 100644 --- a/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DetailsRequestAuthenticationData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,7 +153,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DetailsRequestAuthenticationData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DetailsRequestAuthenticationData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DetailsRequestAuthenticationData` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java b/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java index a66a99971..e14791b12 100644 --- a/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -268,6 +270,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DeviceRenderOptions.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -288,7 +294,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DeviceRenderOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeviceRenderOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DeviceRenderOptions` properties.", entry.getKey())); } } // ensure the field sdkInterface can be parsed to an enum value @@ -300,7 +306,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("sdkUiType") != null && !jsonObj.get("sdkUiType").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkUiType` to be an array in the JSON string but got `%s`", jsonObj.get("sdkUiType").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkUiType` to be an array in the JSON string but got `%s`", jsonObj.get("sdkUiType").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/DokuDetails.java b/src/main/java/com/adyen/model/checkout/DokuDetails.java index e58c4f0eb..e572a8a3c 100644 --- a/src/main/java/com/adyen/model/checkout/DokuDetails.java +++ b/src/main/java/com/adyen/model/checkout/DokuDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -308,6 +310,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("shopperEmail"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DokuDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -328,7 +334,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DokuDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DokuDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DokuDetails` properties.", entry.getKey())); } } @@ -340,19 +346,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // 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/checkout/DonationResponse.java b/src/main/java/com/adyen/model/checkout/DonationResponse.java index e2805fa88..ebce9bcae 100644 --- a/src/main/java/com/adyen/model/checkout/DonationResponse.java +++ b/src/main/java/com/adyen/model/checkout/DonationResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -352,6 +354,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DonationResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -372,7 +378,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DonationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DonationResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DonationResponse` properties.", entry.getKey())); } } // validate the optional field `amount` @@ -381,15 +387,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field donationAccount if (jsonObj.get("donationAccount") != null && !jsonObj.get("donationAccount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationAccount").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationAccount").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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 `payment` if (jsonObj.getAsJsonObject("payment") != null) { @@ -397,7 +403,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/checkout/DotpayDetails.java b/src/main/java/com/adyen/model/checkout/DotpayDetails.java index ca7f0daa5..8a377442c 100644 --- a/src/main/java/com/adyen/model/checkout/DotpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/DotpayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -231,6 +233,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("issuer"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DotpayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -251,7 +257,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DotpayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DotpayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DotpayDetails` properties.", entry.getKey())); } } @@ -263,11 +269,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); } // 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/checkout/DragonpayDetails.java b/src/main/java/com/adyen/model/checkout/DragonpayDetails.java index 9c41f4bbe..e35ba366e 100644 --- a/src/main/java/com/adyen/model/checkout/DragonpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/DragonpayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -267,6 +269,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuer"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DragonpayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -287,7 +293,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DragonpayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DragonpayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DragonpayDetails` properties.", entry.getKey())); } } @@ -299,15 +305,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // 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/checkout/EcontextVoucherDetails.java b/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java index b91cd84fd..adf8fb6cc 100644 --- a/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java +++ b/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -324,6 +326,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("telephoneNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(EcontextVoucherDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -344,7 +350,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!EcontextVoucherDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EcontextVoucherDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `EcontextVoucherDetails` properties.", entry.getKey())); } } @@ -356,23 +362,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // 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/checkout/EncryptedOrderData.java b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java index 6119b38e5..2022c7338 100644 --- a/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java +++ b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("orderData"); openapiRequiredFields.add("pspReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(EncryptedOrderData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `EncryptedOrderData` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderData if (jsonObj.get("orderData") != null && !jsonObj.get("orderData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderData").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderData").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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ExternalPlatform.java b/src/main/java/com/adyen/model/checkout/ExternalPlatform.java index 93e15f57b..b8ca58141 100644 --- a/src/main/java/com/adyen/model/checkout/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/checkout/ExternalPlatform.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ExternalPlatform.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ExternalPlatform.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExternalPlatform` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ExternalPlatform` properties.", entry.getKey())); } } // validate the optional field integrator if (jsonObj.get("integrator") != null && !jsonObj.get("integrator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `integrator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrator").toString())); + log.log(Level.WARNING, String.format("Expected the field `integrator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrator").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field version if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + log.log(Level.WARNING, String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ForexQuote.java b/src/main/java/com/adyen/model/checkout/ForexQuote.java index 3e36e0516..c70a3911d 100644 --- a/src/main/java/com/adyen/model/checkout/ForexQuote.java +++ b/src/main/java/com/adyen/model/checkout/ForexQuote.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -450,6 +452,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("basePoints"); openapiRequiredFields.add("validTill"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ForexQuote.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -470,7 +476,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ForexQuote.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ForexQuote` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ForexQuote` properties.", entry.getKey())); } } @@ -482,11 +488,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field account if (jsonObj.get("account") != null && !jsonObj.get("account").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); + log.log(Level.WARNING, String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); } // 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())); + log.log(Level.WARNING, 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 `baseAmount` if (jsonObj.getAsJsonObject("baseAmount") != null) { @@ -502,7 +508,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `sell` if (jsonObj.getAsJsonObject("sell") != null) { @@ -510,15 +516,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field signature if (jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + log.log(Level.WARNING, String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); } // validate the optional field source if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + log.log(Level.WARNING, String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/FraudCheckResult.java b/src/main/java/com/adyen/model/checkout/FraudCheckResult.java index c728311a9..8092455cf 100644 --- a/src/main/java/com/adyen/model/checkout/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudCheckResult.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("checkId"); openapiRequiredFields.add("name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudCheckResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FraudCheckResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResult` properties.", entry.getKey())); } } @@ -220,7 +226,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/FraudResult.java b/src/main/java/com/adyen/model/checkout/FraudResult.java index 5a7f53df0..8ccb4495d 100644 --- a/src/main/java/com/adyen/model/checkout/FraudResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudResult.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("accountScore"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FraudResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudResult` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/checkout/FundOrigin.java b/src/main/java/com/adyen/model/checkout/FundOrigin.java index 545910fc4..7044d83f6 100644 --- a/src/main/java/com/adyen/model/checkout/FundOrigin.java +++ b/src/main/java/com/adyen/model/checkout/FundOrigin.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FundOrigin.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FundOrigin.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FundOrigin` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FundOrigin` properties.", entry.getKey())); } } // validate the optional field `billingAddress` diff --git a/src/main/java/com/adyen/model/checkout/FundRecipient.java b/src/main/java/com/adyen/model/checkout/FundRecipient.java index 5351da9bf..065b94206 100644 --- a/src/main/java/com/adyen/model/checkout/FundRecipient.java +++ b/src/main/java/com/adyen/model/checkout/FundRecipient.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -392,6 +394,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FundRecipient.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -412,7 +418,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FundRecipient.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FundRecipient` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FundRecipient` properties.", entry.getKey())); } } // validate the optional field `billingAddress` @@ -425,7 +431,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -433,11 +439,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // validate the optional field `subMerchant` if (jsonObj.getAsJsonObject("subMerchant") != null) { @@ -445,15 +451,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field walletIdentifier if (jsonObj.get("walletIdentifier") != null && !jsonObj.get("walletIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `walletIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("walletIdentifier").toString())); + log.log(Level.WARNING, String.format("Expected the field `walletIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("walletIdentifier").toString())); } // validate the optional field walletOwnerTaxId if (jsonObj.get("walletOwnerTaxId") != null && !jsonObj.get("walletOwnerTaxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `walletOwnerTaxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("walletOwnerTaxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `walletOwnerTaxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("walletOwnerTaxId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java index 7bfddabba..0a210b699 100644 --- a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -301,6 +303,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuer"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GenericIssuerPaymentMethodDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -321,7 +327,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GenericIssuerPaymentMethodDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenericIssuerPaymentMethodDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GenericIssuerPaymentMethodDetails` properties.", entry.getKey())); } } @@ -333,19 +339,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/GiropayDetails.java b/src/main/java/com/adyen/model/checkout/GiropayDetails.java index 62179d33d..9cd7f74db 100644 --- a/src/main/java/com/adyen/model/checkout/GiropayDetails.java +++ b/src/main/java/com/adyen/model/checkout/GiropayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -264,6 +266,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GiropayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -284,20 +290,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GiropayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GiropayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GiropayDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/GooglePayDetails.java b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java index d2c6dc454..0d19562e8 100644 --- a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -368,6 +370,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("googlePayToken"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GooglePayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -388,7 +394,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GooglePayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GooglePayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GooglePayDetails` properties.", entry.getKey())); } } @@ -400,7 +406,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -411,15 +417,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field googlePayToken if (jsonObj.get("googlePayToken") != null && !jsonObj.get("googlePayToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `googlePayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googlePayToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `googlePayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googlePayToken").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/IdealDetails.java b/src/main/java/com/adyen/model/checkout/IdealDetails.java index d66cdcaa5..e54faf4a8 100644 --- a/src/main/java/com/adyen/model/checkout/IdealDetails.java +++ b/src/main/java/com/adyen/model/checkout/IdealDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -294,6 +296,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("issuer"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IdealDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -314,7 +320,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!IdealDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdealDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IdealDetails` properties.", entry.getKey())); } } @@ -326,19 +332,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/InputDetail.java b/src/main/java/com/adyen/model/checkout/InputDetail.java index 736855565..7bf5bfb06 100644 --- a/src/main/java/com/adyen/model/checkout/InputDetail.java +++ b/src/main/java/com/adyen/model/checkout/InputDetail.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -402,6 +404,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InputDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -422,7 +428,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!InputDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InputDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InputDetail` properties.", entry.getKey())); } } JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); @@ -451,7 +457,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field itemSearchUrl if (jsonObj.get("itemSearchUrl") != null && !jsonObj.get("itemSearchUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `itemSearchUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemSearchUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `itemSearchUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemSearchUrl").toString())); } JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); if (jsonArrayitems != null) { @@ -467,15 +473,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field key if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + log.log(Level.WARNING, String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/InstallmentOption.java b/src/main/java/com/adyen/model/checkout/InstallmentOption.java index 9dff6f8e0..4d43e8236 100644 --- a/src/main/java/com/adyen/model/checkout/InstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/InstallmentOption.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -279,6 +281,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InstallmentOption.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -299,16 +305,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!InstallmentOption.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InstallmentOption` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InstallmentOption` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("plans") != null && !jsonObj.get("plans").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `plans` to be an array in the JSON string but got `%s`", jsonObj.get("plans").toString())); + log.log(Level.WARNING, String.format("Expected the field `plans` to be an array in the JSON string but got `%s`", jsonObj.get("plans").toString())); } // ensure the json data is an array if (jsonObj.get("values") != null && !jsonObj.get("values").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); + log.log(Level.WARNING, String.format("Expected the field `values` to be an array in the JSON string but got `%s`", jsonObj.get("values").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/Installments.java b/src/main/java/com/adyen/model/checkout/Installments.java index c6289fbcd..eb11f2c03 100644 --- a/src/main/java/com/adyen/model/checkout/Installments.java +++ b/src/main/java/com/adyen/model/checkout/Installments.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -204,6 +206,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Installments.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -224,7 +230,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Installments.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Installments` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Installments` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/checkout/InstallmentsNumber.java b/src/main/java/com/adyen/model/checkout/InstallmentsNumber.java index 593aa73e4..7afb6276b 100644 --- a/src/main/java/com/adyen/model/checkout/InstallmentsNumber.java +++ b/src/main/java/com/adyen/model/checkout/InstallmentsNumber.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("maxNumberOfInstallments"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InstallmentsNumber.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!InstallmentsNumber.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InstallmentsNumber` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InstallmentsNumber` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/checkout/Item.java b/src/main/java/com/adyen/model/checkout/Item.java index 36c3d0301..bf7fe8041 100644 --- a/src/main/java/com/adyen/model/checkout/Item.java +++ b/src/main/java/com/adyen/model/checkout/Item.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Item.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Item.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Item` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Item` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java index d60911f97..ec2d9cae7 100644 --- a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java +++ b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -364,6 +366,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(KlarnaDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -384,7 +390,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!KlarnaDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KlarnaDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `KlarnaDetails` properties.", entry.getKey())); } } @@ -396,27 +402,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingAddress if (jsonObj.get("billingAddress") != null && !jsonObj.get("billingAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field deliveryAddress if (jsonObj.get("deliveryAddress") != null && !jsonObj.get("deliveryAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); } // validate the optional field personalDetails if (jsonObj.get("personalDetails") != null && !jsonObj.get("personalDetails").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").toString())); + log.log(Level.WARNING, String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/LineItem.java b/src/main/java/com/adyen/model/checkout/LineItem.java index 69c671ac1..adcfadc79 100644 --- a/src/main/java/com/adyen/model/checkout/LineItem.java +++ b/src/main/java/com/adyen/model/checkout/LineItem.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -591,6 +593,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LineItem.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -611,56 +617,56 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LineItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LineItem` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LineItem` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field color if (jsonObj.get("color") != null && !jsonObj.get("color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").toString())); + log.log(Level.WARNING, String.format("Expected the field `color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("color").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field imageUrl if (jsonObj.get("imageUrl") != null && !jsonObj.get("imageUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `imageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imageUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `imageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("imageUrl").toString())); } // validate the optional field itemCategory if (jsonObj.get("itemCategory") != null && !jsonObj.get("itemCategory").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `itemCategory` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemCategory").toString())); + log.log(Level.WARNING, String.format("Expected the field `itemCategory` to be a primitive type in the JSON string but got `%s`", jsonObj.get("itemCategory").toString())); } // validate the optional field manufacturer if (jsonObj.get("manufacturer") != null && !jsonObj.get("manufacturer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `manufacturer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manufacturer").toString())); + log.log(Level.WARNING, String.format("Expected the field `manufacturer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manufacturer").toString())); } // validate the optional field productUrl if (jsonObj.get("productUrl") != null && !jsonObj.get("productUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `productUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `productUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("productUrl").toString())); } // validate the optional field receiverEmail if (jsonObj.get("receiverEmail") != null && !jsonObj.get("receiverEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `receiverEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiverEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `receiverEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiverEmail").toString())); } // validate the optional field size if (jsonObj.get("size") != null && !jsonObj.get("size").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("size").toString())); + log.log(Level.WARNING, String.format("Expected the field `size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("size").toString())); } // validate the optional field sku if (jsonObj.get("sku") != null && !jsonObj.get("sku").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sku").toString())); + log.log(Level.WARNING, String.format("Expected the field `sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sku").toString())); } // validate the optional field upc if (jsonObj.get("upc") != null && !jsonObj.get("upc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `upc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upc").toString())); + log.log(Level.WARNING, String.format("Expected the field `upc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("upc").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java index 68f456abe..faac5ff7e 100644 --- a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -196,6 +198,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListStoredPaymentMethodsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -216,16 +222,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListStoredPaymentMethodsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListStoredPaymentMethodsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListStoredPaymentMethodsResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } JsonArray jsonArraystoredPaymentMethods = jsonObj.getAsJsonArray("storedPaymentMethods"); if (jsonArraystoredPaymentMethods != null) { diff --git a/src/main/java/com/adyen/model/checkout/Mandate.java b/src/main/java/com/adyen/model/checkout/Mandate.java index a524fd17b..b679ff248 100644 --- a/src/main/java/com/adyen/model/checkout/Mandate.java +++ b/src/main/java/com/adyen/model/checkout/Mandate.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -488,6 +490,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("endsAt"); openapiRequiredFields.add("frequency"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Mandate.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -508,7 +514,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Mandate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Mandate` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Mandate` properties.", entry.getKey())); } } @@ -520,7 +526,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field amount if (jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount").toString())); + log.log(Level.WARNING, String.format("Expected the field `amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount").toString())); } // ensure the field amountRule can be parsed to an enum value if (jsonObj.get("amountRule") != null) { @@ -538,11 +544,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingDay if (jsonObj.get("billingDay") != null && !jsonObj.get("billingDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingDay").toString())); } // validate the optional field endsAt if (jsonObj.get("endsAt") != null && !jsonObj.get("endsAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endsAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `endsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endsAt").toString())); } // ensure the field frequency can be parsed to an enum value if (jsonObj.get("frequency") != null) { @@ -553,11 +559,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field remarks if (jsonObj.get("remarks") != null && !jsonObj.get("remarks").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); + log.log(Level.WARNING, String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); } // validate the optional field startsAt if (jsonObj.get("startsAt") != null && !jsonObj.get("startsAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startsAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `startsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startsAt").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/MasterpassDetails.java b/src/main/java/com/adyen/model/checkout/MasterpassDetails.java index f4c314aec..a1abdfcc8 100644 --- a/src/main/java/com/adyen/model/checkout/MasterpassDetails.java +++ b/src/main/java/com/adyen/model/checkout/MasterpassDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -305,6 +307,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("masterpassTransactionId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MasterpassDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -325,7 +331,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MasterpassDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MasterpassDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MasterpassDetails` properties.", entry.getKey())); } } @@ -337,7 +343,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -348,7 +354,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field masterpassTransactionId if (jsonObj.get("masterpassTransactionId") != null && !jsonObj.get("masterpassTransactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `masterpassTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masterpassTransactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `masterpassTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masterpassTransactionId").toString())); } // 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/checkout/MbwayDetails.java b/src/main/java/com/adyen/model/checkout/MbwayDetails.java index 68fce3b75..fb1e56782 100644 --- a/src/main/java/com/adyen/model/checkout/MbwayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MbwayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -261,6 +263,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("shopperEmail"); openapiRequiredFields.add("telephoneNumber"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MbwayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -281,7 +287,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MbwayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MbwayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MbwayDetails` properties.", entry.getKey())); } } @@ -293,15 +299,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // 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/checkout/MerchantDevice.java b/src/main/java/com/adyen/model/checkout/MerchantDevice.java index 61eba2c5d..bfad8fe8c 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantDevice.java +++ b/src/main/java/com/adyen/model/checkout/MerchantDevice.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantDevice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantDevice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantDevice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantDevice` properties.", entry.getKey())); } } // validate the optional field os if (jsonObj.get("os") != null && !jsonObj.get("os").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); + log.log(Level.WARNING, String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); } // validate the optional field osVersion if (jsonObj.get("osVersion") != null && !jsonObj.get("osVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").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())); + log.log(Level.WARNING, 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/checkout/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java index 54234f7e4..bdfbe2d7a 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -619,6 +621,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantRiskIndicator.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -639,7 +645,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantRiskIndicator.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantRiskIndicator` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantRiskIndicator` properties.", entry.getKey())); } } // ensure the field deliveryAddressIndicator can be parsed to an enum value @@ -651,11 +657,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deliveryEmail if (jsonObj.get("deliveryEmail") != null && !jsonObj.get("deliveryEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmail").toString())); } // validate the optional field deliveryEmailAddress if (jsonObj.get("deliveryEmailAddress") != null && !jsonObj.get("deliveryEmailAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmailAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmailAddress").toString())); } // ensure the field deliveryTimeframe can be parsed to an enum value if (jsonObj.get("deliveryTimeframe") != null) { @@ -670,19 +676,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field giftCardCurr if (jsonObj.get("giftCardCurr") != null && !jsonObj.get("giftCardCurr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `giftCardCurr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("giftCardCurr").toString())); + log.log(Level.WARNING, String.format("Expected the field `giftCardCurr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("giftCardCurr").toString())); } // validate the optional field preOrderPurchaseInd if (jsonObj.get("preOrderPurchaseInd") != null && !jsonObj.get("preOrderPurchaseInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `preOrderPurchaseInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("preOrderPurchaseInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `preOrderPurchaseInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("preOrderPurchaseInd").toString())); } // validate the optional field reorderItemsInd if (jsonObj.get("reorderItemsInd") != null && !jsonObj.get("reorderItemsInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `reorderItemsInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reorderItemsInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `reorderItemsInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reorderItemsInd").toString())); } // validate the optional field shipIndicator if (jsonObj.get("shipIndicator") != null && !jsonObj.get("shipIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shipIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `shipIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipIndicator").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/MobilePayDetails.java b/src/main/java/com/adyen/model/checkout/MobilePayDetails.java index 5d458301b..8f342d576 100644 --- a/src/main/java/com/adyen/model/checkout/MobilePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MobilePayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MobilePayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,12 +227,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MobilePayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MobilePayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MobilePayDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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/checkout/ModelConfiguration.java b/src/main/java/com/adyen/model/checkout/ModelConfiguration.java index 10c76ff01..44fa82dcd 100644 --- a/src/main/java/com/adyen/model/checkout/ModelConfiguration.java +++ b/src/main/java/com/adyen/model/checkout/ModelConfiguration.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -266,6 +268,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ModelConfiguration.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -286,7 +292,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ModelConfiguration.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ModelConfiguration` properties.", entry.getKey())); } } // validate the optional field `avs` diff --git a/src/main/java/com/adyen/model/checkout/MolPayDetails.java b/src/main/java/com/adyen/model/checkout/MolPayDetails.java index 1272291aa..a3b4f798d 100644 --- a/src/main/java/com/adyen/model/checkout/MolPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MolPayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -234,6 +236,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("issuer"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MolPayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -254,7 +260,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MolPayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MolPayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MolPayDetails` properties.", entry.getKey())); } } @@ -266,11 +272,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field issuer if (jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuer").toString())); } // 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/checkout/Name.java b/src/main/java/com/adyen/model/checkout/Name.java index 948f9c0df..570c75ed0 100644 --- a/src/main/java/com/adyen/model/checkout/Name.java +++ b/src/main/java/com/adyen/model/checkout/Name.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java index a060c7335..7ff468feb 100644 --- a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java +++ b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -355,6 +357,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OpenInvoiceDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -375,32 +381,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OpenInvoiceDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OpenInvoiceDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OpenInvoiceDetails` properties.", entry.getKey())); } } // validate the optional field billingAddress if (jsonObj.get("billingAddress") != null && !jsonObj.get("billingAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field deliveryAddress if (jsonObj.get("deliveryAddress") != null && !jsonObj.get("deliveryAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); } // validate the optional field personalDetails if (jsonObj.get("personalDetails") != null && !jsonObj.get("personalDetails").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").toString())); + log.log(Level.WARNING, String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/PayPalDetails.java b/src/main/java/com/adyen/model/checkout/PayPalDetails.java index eb9ef5cf5..93cb247ef 100644 --- a/src/main/java/com/adyen/model/checkout/PayPalDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayPalDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -399,6 +401,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayPalDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -419,7 +425,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayPalDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayPalDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayPalDetails` properties.", entry.getKey())); } } @@ -431,23 +437,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field orderID if (jsonObj.get("orderID") != null && !jsonObj.get("orderID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderID").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderID").toString())); } // validate the optional field payerID if (jsonObj.get("payerID") != null && !jsonObj.get("payerID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payerID").toString())); + log.log(Level.WARNING, String.format("Expected the field `payerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payerID").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // ensure the field subtype can be parsed to an enum value if (jsonObj.get("subtype") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java index e97732875..80e2d597d 100644 --- a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -323,6 +325,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayUUpiDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -343,7 +349,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayUUpiDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayUUpiDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayUUpiDetails` properties.", entry.getKey())); } } @@ -355,19 +361,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 shopperNotificationReference if (jsonObj.get("shopperNotificationReference") != null && !jsonObj.get("shopperNotificationReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); } // validate the optional field storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -378,7 +384,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field virtualPaymentAddress if (jsonObj.get("virtualPaymentAddress") != null && !jsonObj.get("virtualPaymentAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `virtualPaymentAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("virtualPaymentAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `virtualPaymentAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("virtualPaymentAddress").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java index 47d8cd1e5..1507c0414 100644 --- a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -368,6 +370,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("googlePayToken"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayWithGoogleDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -388,7 +394,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayWithGoogleDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayWithGoogleDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayWithGoogleDetails` properties.", entry.getKey())); } } @@ -400,7 +406,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -411,15 +417,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field googlePayToken if (jsonObj.get("googlePayToken") != null && !jsonObj.get("googlePayToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `googlePayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googlePayToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `googlePayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googlePayToken").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/PaymentAmountUpdateResource.java b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java index 37b6e0f93..04c68bc09 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResource.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -442,6 +444,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentAmountUpdateResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -462,7 +468,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentAmountUpdateResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentAmountUpdateResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentAmountUpdateResource` properties.", entry.getKey())); } } @@ -485,19 +491,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 paymentPspReference if (jsonObj.get("paymentPspReference") != null && !jsonObj.get("paymentPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentCancelResource.java b/src/main/java/com/adyen/model/checkout/PaymentCancelResource.java index 3a0da5e91..8066255b7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCancelResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCancelResource.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -292,6 +294,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentCancelResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -312,7 +318,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentCancelResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentCancelResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentCancelResource` properties.", entry.getKey())); } } @@ -324,19 +330,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 paymentPspReference if (jsonObj.get("paymentPspReference") != null && !jsonObj.get("paymentPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java index 718c0def0..e47fbb80c 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureResource.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -401,6 +403,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentCaptureResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -421,7 +427,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentCaptureResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentCaptureResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentCaptureResource` properties.", entry.getKey())); } } @@ -449,19 +455,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 paymentPspReference if (jsonObj.get("paymentPspReference") != null && !jsonObj.get("paymentPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java b/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java index 39f9c1eb3..3d1899036 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -591,6 +593,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentCompletionDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -611,76 +617,76 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentCompletionDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentCompletionDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentCompletionDetails` properties.", entry.getKey())); } } // validate the optional field MD if (jsonObj.get("MD") != null && !jsonObj.get("MD").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `MD` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MD").toString())); + log.log(Level.WARNING, String.format("Expected the field `MD` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MD").toString())); } // validate the optional field PaReq if (jsonObj.get("PaReq") != null && !jsonObj.get("PaReq").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PaReq` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaReq").toString())); + log.log(Level.WARNING, String.format("Expected the field `PaReq` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaReq").toString())); } // validate the optional field PaRes if (jsonObj.get("PaRes") != null && !jsonObj.get("PaRes").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PaRes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaRes").toString())); + log.log(Level.WARNING, String.format("Expected the field `PaRes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PaRes").toString())); } // validate the optional field billingToken if (jsonObj.get("billingToken") != null && !jsonObj.get("billingToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingToken").toString())); } // validate the optional field cupsecureplus.smscode if (jsonObj.get("cupsecureplus.smscode") != null && !jsonObj.get("cupsecureplus.smscode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cupsecureplus.smscode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cupsecureplus.smscode").toString())); + log.log(Level.WARNING, String.format("Expected the field `cupsecureplus.smscode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cupsecureplus.smscode").toString())); } // validate the optional field facilitatorAccessToken if (jsonObj.get("facilitatorAccessToken") != null && !jsonObj.get("facilitatorAccessToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `facilitatorAccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("facilitatorAccessToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `facilitatorAccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("facilitatorAccessToken").toString())); } // validate the optional field oneTimePasscode if (jsonObj.get("oneTimePasscode") != null && !jsonObj.get("oneTimePasscode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `oneTimePasscode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oneTimePasscode").toString())); + log.log(Level.WARNING, String.format("Expected the field `oneTimePasscode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oneTimePasscode").toString())); } // validate the optional field orderID if (jsonObj.get("orderID") != null && !jsonObj.get("orderID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderID").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderID").toString())); } // validate the optional field payerID if (jsonObj.get("payerID") != null && !jsonObj.get("payerID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payerID").toString())); + log.log(Level.WARNING, String.format("Expected the field `payerID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payerID").toString())); } // validate the optional field payload if (jsonObj.get("payload") != null && !jsonObj.get("payload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + log.log(Level.WARNING, String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); } // validate the optional field paymentID if (jsonObj.get("paymentID") != null && !jsonObj.get("paymentID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentID").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentID").toString())); } // validate the optional field paymentStatus if (jsonObj.get("paymentStatus") != null && !jsonObj.get("paymentStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentStatus").toString())); } // validate the optional field redirectResult if (jsonObj.get("redirectResult") != null && !jsonObj.get("redirectResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectResult").toString())); } // validate the optional field resultCode if (jsonObj.get("resultCode") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } // validate the optional field threeDSResult if (jsonObj.get("threeDSResult") != null && !jsonObj.get("threeDSResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSResult").toString())); } // validate the optional field threeds2.challengeResult if (jsonObj.get("threeds2.challengeResult") != null && !jsonObj.get("threeds2.challengeResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeds2.challengeResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeds2.challengeResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeds2.challengeResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeds2.challengeResult").toString())); } // validate the optional field threeds2.fingerprint if (jsonObj.get("threeds2.fingerprint") != null && !jsonObj.get("threeds2.fingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeds2.fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeds2.fingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeds2.fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeds2.fingerprint").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetails.java b/src/main/java/com/adyen/model/checkout/PaymentDetails.java index 5d23f2a0e..4575fffa5 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -137,6 +139,8 @@ public enum TypeEnum { ALMA("alma"), + PAYPO("paypo"), + MOLPAY_FPX("molpay_fpx"), KONBINI("konbini"), @@ -377,6 +381,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -397,12 +405,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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/checkout/PaymentDetailsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java index a3dc0e5f8..f0c995661 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -619,6 +621,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentDetailsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -639,7 +645,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentDetailsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentDetailsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentDetailsResponse` properties.", entry.getKey())); } } // validate the optional field `amount` @@ -648,7 +654,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field donationToken if (jsonObj.get("donationToken") != null && !jsonObj.get("donationToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationToken").toString())); } // validate the optional field `fraudResult` if (jsonObj.getAsJsonObject("fraudResult") != null) { @@ -656,7 +662,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { @@ -668,15 +674,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); } // validate the optional field refusalReasonCode if (jsonObj.get("refusalReasonCode") != null && !jsonObj.get("refusalReasonCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refusalReasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `refusalReasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonCode").toString())); } // ensure the field resultCode can be parsed to an enum value if (jsonObj.get("resultCode") != null) { @@ -687,7 +693,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `threeDS2ResponseData` if (jsonObj.getAsJsonObject("threeDS2ResponseData") != null) { @@ -699,7 +705,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSPaymentData if (jsonObj.get("threeDSPaymentData") != null && !jsonObj.get("threeDSPaymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSPaymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSPaymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSPaymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSPaymentData").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java index 0768d7db6..f6b21ae83 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDonationRequest.java @@ -66,6 +66,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -2368,6 +2370,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("returnUrl"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentDonationRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -2388,7 +2394,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentDonationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentDonationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentDonationRequest` properties.", entry.getKey())); } } @@ -2435,7 +2441,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field `company` if (jsonObj.getAsJsonObject("company") != null) { @@ -2443,11 +2449,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field conversionId if (jsonObj.get("conversionId") != null && !jsonObj.get("conversionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `conversionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `conversionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversionId").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())); + log.log(Level.WARNING, 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 `dccQuote` if (jsonObj.getAsJsonObject("dccQuote") != null) { @@ -2459,19 +2465,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceFingerprint if (jsonObj.get("deviceFingerprint") != null && !jsonObj.get("deviceFingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); } // validate the optional field donationAccount if (jsonObj.get("donationAccount") != null && !jsonObj.get("donationAccount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationAccount").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationAccount").toString())); } // validate the optional field donationOriginalPspReference if (jsonObj.get("donationOriginalPspReference") != null && !jsonObj.get("donationOriginalPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationOriginalPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationOriginalPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationOriginalPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationOriginalPspReference").toString())); } // validate the optional field donationToken if (jsonObj.get("donationToken") != null && !jsonObj.get("donationToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationToken").toString())); } // ensure the field entityType can be parsed to an enum value if (jsonObj.get("entityType") != null) { @@ -2509,15 +2515,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `merchantRiskIndicator` if (jsonObj.getAsJsonObject("merchantRiskIndicator") != null) { @@ -2533,11 +2539,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field origin if (jsonObj.get("origin") != null && !jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + log.log(Level.WARNING, String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); } // validate the optional field `paymentMethod` if (jsonObj.getAsJsonObject("paymentMethod") != null) { @@ -2549,11 +2555,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2564,19 +2570,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field redirectFromIssuerMethod if (jsonObj.get("redirectFromIssuerMethod") != null && !jsonObj.get("redirectFromIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); } // validate the optional field redirectToIssuerMethod if (jsonObj.get("redirectToIssuerMethod") != null && !jsonObj.get("redirectToIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").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())); + log.log(Level.WARNING, 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 returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -2584,15 +2590,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field sessionValidity if (jsonObj.get("sessionValidity") != null && !jsonObj.get("sessionValidity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionValidity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionValidity").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionValidity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionValidity").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -2603,7 +2609,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -2611,15 +2617,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -2635,11 +2641,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field `threeDS2RequestData` if (jsonObj.getAsJsonObject("threeDS2RequestData") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java index fb934dbc7..19c1f8d10 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java @@ -54,6 +54,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1249,10 +1251,10 @@ public PaymentLinkResponse addSplitsItem(Split splitsItem) { } /** - * An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information). + * An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split). * @return splits **/ - @ApiModelProperty(value = "An array of objects specifying how the payment should be split between accounts when using Adyen for Platforms. For details, refer to [Providing split information](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information).") + @ApiModelProperty(value = "An array of objects specifying how to split a payment when using [Adyen for Platforms](https://docs.adyen.com/marketplaces-and-platforms/processing-payments#providing-split-information), [Classic Platforms integration](https://docs.adyen.com/marketplaces-and-platforms/classic/processing-payments#providing-split-information), or [Issuing](https://docs.adyen.com/issuing/manage-funds#split).") public List getSplits() { return splits; @@ -1588,6 +1590,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("status"); openapiRequiredFields.add("url"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentLinkResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1608,7 +1614,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentLinkResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentLinkResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentLinkResponse` properties.", entry.getKey())); } } @@ -1620,7 +1626,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -1636,11 +1642,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("blockedPaymentMethods") != null && !jsonObj.get("blockedPaymentMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); + log.log(Level.WARNING, String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").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())); + log.log(Level.WARNING, 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 `deliveryAddress` if (jsonObj.getAsJsonObject("deliveryAddress") != null) { @@ -1648,15 +1654,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 expiresAt if (jsonObj.get("expiresAt") != null && !jsonObj.get("expiresAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiresAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiresAt").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } JsonArray jsonArraylineItems = jsonObj.getAsJsonArray("lineItems"); if (jsonArraylineItems != null) { @@ -1672,15 +1678,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -1691,15 +1697,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } // ensure the json data is an array if (jsonObj.get("requiredShopperFields") != null && !jsonObj.get("requiredShopperFields").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `requiredShopperFields` to be an array in the JSON string but got `%s`", jsonObj.get("requiredShopperFields").toString())); + log.log(Level.WARNING, String.format("Expected the field `requiredShopperFields` to be an array in the JSON string but got `%s`", jsonObj.get("requiredShopperFields").toString())); } // validate the optional field returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -1707,11 +1713,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -1719,15 +1725,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -1750,7 +1756,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } // ensure the field storePaymentMethodMode can be parsed to an enum value if (jsonObj.get("storePaymentMethodMode") != null) { @@ -1761,15 +1767,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field themeId if (jsonObj.get("themeId") != null && !jsonObj.get("themeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `themeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("themeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `themeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("themeId").toString())); } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethod.java b/src/main/java/com/adyen/model/checkout/PaymentMethod.java index 001c2281c..dbaaf8954 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethod.java @@ -47,6 +47,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -448,6 +450,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethod.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -468,16 +474,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethod.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethod` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethod` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // ensure the json data is an array if (jsonObj.get("brands") != null && !jsonObj.get("brands").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `brands` to be an array in the JSON string but got `%s`", jsonObj.get("brands").toString())); + log.log(Level.WARNING, String.format("Expected the field `brands` to be an array in the JSON string but got `%s`", jsonObj.get("brands").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -516,11 +522,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java b/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java index b679e4fad..6d266e025 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodGroup.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethodGroup.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodGroup` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodGroup` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field paymentMethodData if (jsonObj.get("paymentMethodData") != null && !jsonObj.get("paymentMethodData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodData").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodData").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java b/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java index c6557039b..590a88b49 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodIssuer.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethodIssuer.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodIssuer` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodIssuer` properties.", entry.getKey())); } } @@ -219,11 +225,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java index 67812827f..27bef2198 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -526,6 +528,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -546,7 +552,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethodsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodsRequest` properties.", entry.getKey())); } } @@ -558,7 +564,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -566,7 +572,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("blockedPaymentMethods") != null && !jsonObj.get("blockedPaymentMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); + log.log(Level.WARNING, String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); } // ensure the field channel can be parsed to an enum value if (jsonObj.get("channel") != null) { @@ -577,11 +583,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 `order` if (jsonObj.getAsJsonObject("order") != null) { @@ -589,15 +595,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java index 8edd722ff..b461c33e0 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -176,6 +178,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -196,7 +202,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethodsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodsResponse` properties.", entry.getKey())); } } JsonArray jsonArraypaymentMethods = jsonObj.getAsJsonArray("paymentMethods"); diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java b/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java index dea547776..58788cd40 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundResource.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -483,6 +485,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentRefundResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -503,7 +509,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentRefundResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentRefundResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentRefundResource` properties.", entry.getKey())); } } @@ -531,7 +537,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); } // ensure the field merchantRefundReason can be parsed to an enum value if (jsonObj.get("merchantRefundReason") != null) { @@ -542,15 +548,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field paymentPspReference if (jsonObj.get("paymentPspReference") != null && !jsonObj.get("paymentPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index b7bc0cdd4..259eca2e5 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -66,6 +66,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -2280,6 +2282,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("returnUrl"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -2300,7 +2306,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest` properties.", entry.getKey())); } } @@ -2347,7 +2353,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field `company` if (jsonObj.getAsJsonObject("company") != null) { @@ -2355,11 +2361,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field conversionId if (jsonObj.get("conversionId") != null && !jsonObj.get("conversionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `conversionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `conversionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversionId").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())); + log.log(Level.WARNING, 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 `dccQuote` if (jsonObj.getAsJsonObject("dccQuote") != null) { @@ -2371,7 +2377,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceFingerprint if (jsonObj.get("deviceFingerprint") != null && !jsonObj.get("deviceFingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); } // ensure the field entityType can be parsed to an enum value if (jsonObj.get("entityType") != null) { @@ -2409,15 +2415,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `merchantRiskIndicator` if (jsonObj.getAsJsonObject("merchantRiskIndicator") != null) { @@ -2433,11 +2439,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field origin if (jsonObj.get("origin") != null && !jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + log.log(Level.WARNING, String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); } // validate the optional field `paymentMethod` if (jsonObj.getAsJsonObject("paymentMethod") != null) { @@ -2449,11 +2455,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2464,19 +2470,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field redirectFromIssuerMethod if (jsonObj.get("redirectFromIssuerMethod") != null && !jsonObj.get("redirectFromIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectFromIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectFromIssuerMethod").toString())); } // validate the optional field redirectToIssuerMethod if (jsonObj.get("redirectToIssuerMethod") != null && !jsonObj.get("redirectToIssuerMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectToIssuerMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectToIssuerMethod").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())); + log.log(Level.WARNING, 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 returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -2484,15 +2490,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field sessionValidity if (jsonObj.get("sessionValidity") != null && !jsonObj.get("sessionValidity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionValidity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionValidity").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionValidity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionValidity").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -2503,7 +2509,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -2511,15 +2517,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -2535,11 +2541,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field `threeDS2RequestData` if (jsonObj.getAsJsonObject("threeDS2RequestData") != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentResponse.java b/src/main/java/com/adyen/model/checkout/PaymentResponse.java index 03906f103..84bfe2b35 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentResponse.java @@ -50,6 +50,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -620,6 +622,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -640,7 +646,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentResponse` properties.", entry.getKey())); } } // validate the optional field `action` @@ -653,7 +659,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field donationToken if (jsonObj.get("donationToken") != null && !jsonObj.get("donationToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationToken").toString())); } // validate the optional field `fraudResult` if (jsonObj.getAsJsonObject("fraudResult") != null) { @@ -661,7 +667,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { @@ -673,15 +679,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); } // validate the optional field refusalReasonCode if (jsonObj.get("refusalReasonCode") != null && !jsonObj.get("refusalReasonCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refusalReasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `refusalReasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonCode").toString())); } // ensure the field resultCode can be parsed to an enum value if (jsonObj.get("resultCode") != null) { @@ -700,7 +706,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSPaymentData if (jsonObj.get("threeDSPaymentData") != null && !jsonObj.get("threeDSPaymentData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSPaymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSPaymentData").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSPaymentData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSPaymentData").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java b/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java index 0d864b3f6..1cf17e199 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java +++ b/src/main/java/com/adyen/model/checkout/PaymentResponseAction.java @@ -472,6 +472,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with CheckoutAwaitAction try { + Logger.getLogger(CheckoutAwaitAction.class.getName()).setLevel(Level.OFF); CheckoutAwaitAction.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -480,6 +481,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CheckoutNativeRedirectAction try { + Logger.getLogger(CheckoutNativeRedirectAction.class.getName()).setLevel(Level.OFF); CheckoutNativeRedirectAction.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -488,6 +490,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CheckoutQrCodeAction try { + Logger.getLogger(CheckoutQrCodeAction.class.getName()).setLevel(Level.OFF); CheckoutQrCodeAction.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -496,6 +499,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CheckoutRedirectAction try { + Logger.getLogger(CheckoutRedirectAction.class.getName()).setLevel(Level.OFF); CheckoutRedirectAction.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -504,6 +508,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CheckoutSDKAction try { + Logger.getLogger(CheckoutSDKAction.class.getName()).setLevel(Level.OFF); CheckoutSDKAction.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -512,6 +517,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CheckoutThreeDS2Action try { + Logger.getLogger(CheckoutThreeDS2Action.class.getName()).setLevel(Level.OFF); CheckoutThreeDS2Action.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -520,6 +526,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CheckoutVoucherAction try { + Logger.getLogger(CheckoutVoucherAction.class.getName()).setLevel(Level.OFF); CheckoutVoucherAction.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentReversalResource.java b/src/main/java/com/adyen/model/checkout/PaymentReversalResource.java index a98b63641..df5e9d48e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentReversalResource.java +++ b/src/main/java/com/adyen/model/checkout/PaymentReversalResource.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -292,6 +294,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentReversalResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -312,7 +318,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentReversalResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentReversalResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentReversalResource` properties.", entry.getKey())); } } @@ -324,19 +330,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 paymentPspReference if (jsonObj.get("paymentPspReference") != null && !jsonObj.get("paymentPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentPspReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java index 7f0c52cbd..527bca570 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupRequest.java @@ -59,6 +59,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1959,6 +1961,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("returnUrl"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentSetupRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1979,7 +1985,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentSetupRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentSetupRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentSetupRequest` properties.", entry.getKey())); } } @@ -1995,7 +2001,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `allowedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("allowedPaymentMethods").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -2011,7 +2017,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("blockedPaymentMethods") != null && !jsonObj.get("blockedPaymentMethods").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); + log.log(Level.WARNING, String.format("Expected the field `blockedPaymentMethods` to be an array in the JSON string but got `%s`", jsonObj.get("blockedPaymentMethods").toString())); } // ensure the field channel can be parsed to an enum value if (jsonObj.get("channel") != null) { @@ -2022,7 +2028,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field `company` if (jsonObj.getAsJsonObject("company") != null) { @@ -2034,11 +2040,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field conversionId if (jsonObj.get("conversionId") != null && !jsonObj.get("conversionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `conversionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `conversionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conversionId").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())); + log.log(Level.WARNING, 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 `dccQuote` if (jsonObj.getAsJsonObject("dccQuote") != null) { @@ -2077,23 +2083,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field origin if (jsonObj.get("origin") != null && !jsonObj.get("origin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); + log.log(Level.WARNING, String.format("Expected the field `origin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("origin").toString())); } // validate the optional field `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -2101,19 +2107,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").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())); + log.log(Level.WARNING, 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 returnUrl if (jsonObj.get("returnUrl") != null && !jsonObj.get("returnUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `returnUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("returnUrl").toString())); } // validate the optional field `riskData` if (jsonObj.getAsJsonObject("riskData") != null) { @@ -2121,19 +2127,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field sdkVersion if (jsonObj.get("sdkVersion") != null && !jsonObj.get("sdkVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkVersion").toString())); } // validate the optional field sessionValidity if (jsonObj.get("sessionValidity") != null && !jsonObj.get("sessionValidity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionValidity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionValidity").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionValidity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionValidity").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -2144,7 +2150,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -2152,15 +2158,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -2176,15 +2182,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field token if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + log.log(Level.WARNING, String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java b/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java index 61ff3e057..0b9a57272 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentSetupResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -172,6 +174,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentSetupResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -192,12 +198,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentSetupResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentSetupResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentSetupResponse` properties.", entry.getKey())); } } // validate the optional field paymentSession if (jsonObj.get("paymentSession") != null && !jsonObj.get("paymentSession").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentSession` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentSession").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentSession` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentSession").toString())); } JsonArray jsonArrayrecurringDetails = jsonObj.getAsJsonArray("recurringDetails"); if (jsonArrayrecurringDetails != null) { diff --git a/src/main/java/com/adyen/model/checkout/PaymentVerificationRequest.java b/src/main/java/com/adyen/model/checkout/PaymentVerificationRequest.java index 12bdf2e6f..e316450cf 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentVerificationRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentVerificationRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("payload"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentVerificationRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentVerificationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentVerificationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentVerificationRequest` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field payload if (jsonObj.get("payload") != null && !jsonObj.get("payload").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); + log.log(Level.WARNING, String.format("Expected the field `payload` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payload").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PaymentVerificationResponse.java b/src/main/java/com/adyen/model/checkout/PaymentVerificationResponse.java index a75e26eaa..dabd12d3c 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentVerificationResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentVerificationResponse.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -473,6 +475,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantReference"); openapiRequiredFields.add("shopperLocale"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentVerificationResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -493,7 +499,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentVerificationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentVerificationResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentVerificationResponse` properties.", entry.getKey())); } } @@ -509,7 +515,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field `order` if (jsonObj.getAsJsonObject("order") != null) { @@ -517,15 +523,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); } // validate the optional field refusalReasonCode if (jsonObj.get("refusalReasonCode") != null && !jsonObj.get("refusalReasonCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refusalReasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `refusalReasonCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonCode").toString())); } // ensure the field resultCode can be parsed to an enum value if (jsonObj.get("resultCode") != null) { @@ -540,7 +546,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/Phone.java b/src/main/java/com/adyen/model/checkout/Phone.java index 5e06ea14e..7818610fe 100644 --- a/src/main/java/com/adyen/model/checkout/Phone.java +++ b/src/main/java/com/adyen/model/checkout/Phone.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Phone.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Phone.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Phone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Phone` properties.", entry.getKey())); } } // validate the optional field cc if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cc").toString())); + log.log(Level.WARNING, String.format("Expected the field `cc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cc").toString())); } // validate the optional field subscriber if (jsonObj.get("subscriber") != null && !jsonObj.get("subscriber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subscriber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriber").toString())); + log.log(Level.WARNING, String.format("Expected the field `subscriber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriber").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java index f83691b0b..f90b88096 100644 --- a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -234,6 +236,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PlatformChargebackLogic.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -254,7 +260,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PlatformChargebackLogic.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PlatformChargebackLogic` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PlatformChargebackLogic` properties.", entry.getKey())); } } // ensure the field behavior can be parsed to an enum value @@ -266,11 +272,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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/RatepayDetails.java b/src/main/java/com/adyen/model/checkout/RatepayDetails.java index 85911dd27..d5e839df3 100644 --- a/src/main/java/com/adyen/model/checkout/RatepayDetails.java +++ b/src/main/java/com/adyen/model/checkout/RatepayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -354,6 +356,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RatepayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -374,7 +380,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RatepayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RatepayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RatepayDetails` properties.", entry.getKey())); } } @@ -386,27 +392,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingAddress if (jsonObj.get("billingAddress") != null && !jsonObj.get("billingAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field deliveryAddress if (jsonObj.get("deliveryAddress") != null && !jsonObj.get("deliveryAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryAddress").toString())); } // validate the optional field personalDetails if (jsonObj.get("personalDetails") != null && !jsonObj.get("personalDetails").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").toString())); + log.log(Level.WARNING, String.format("Expected the field `personalDetails` to be a primitive type in the JSON string but got `%s`", jsonObj.get("personalDetails").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/Recurring.java b/src/main/java/com/adyen/model/checkout/Recurring.java index f9fde06b2..7098f5917 100644 --- a/src/main/java/com/adyen/model/checkout/Recurring.java +++ b/src/main/java/com/adyen/model/checkout/Recurring.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -340,6 +342,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Recurring.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -360,7 +366,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Recurring.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties.", entry.getKey())); } } // ensure the field contract can be parsed to an enum value @@ -372,11 +378,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringDetailName if (jsonObj.get("recurringDetailName") != null && !jsonObj.get("recurringDetailName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field tokenService can be parsed to an enum value if (jsonObj.get("tokenService") != null) { diff --git a/src/main/java/com/adyen/model/checkout/RecurringDetail.java b/src/main/java/com/adyen/model/checkout/RecurringDetail.java index 1be1615d2..22fbf98bd 100644 --- a/src/main/java/com/adyen/model/checkout/RecurringDetail.java +++ b/src/main/java/com/adyen/model/checkout/RecurringDetail.java @@ -48,6 +48,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -507,6 +509,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RecurringDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -527,16 +533,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RecurringDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecurringDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RecurringDetail` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // ensure the json data is an array if (jsonObj.get("brands") != null && !jsonObj.get("brands").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `brands` to be an array in the JSON string but got `%s`", jsonObj.get("brands").toString())); + log.log(Level.WARNING, String.format("Expected the field `brands` to be an array in the JSON string but got `%s`", jsonObj.get("brands").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -575,11 +581,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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 `storedDetails` if (jsonObj.getAsJsonObject("storedDetails") != null) { @@ -587,7 +593,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java index b01b4d277..fd48fb7f8 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -243,6 +245,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalData3DSecure.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -263,24 +269,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalData3DSecure.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalData3DSecure` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalData3DSecure` properties.", entry.getKey())); } } // validate the optional field cardHolderInfo if (jsonObj.get("cardHolderInfo") != null && !jsonObj.get("cardHolderInfo").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); } // validate the optional field cavv if (jsonObj.get("cavv") != null && !jsonObj.get("cavv").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // validate the optional field scaExemptionRequested if (jsonObj.get("scaExemptionRequested") != null && !jsonObj.get("scaExemptionRequested").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scaExemptionRequested` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemptionRequested").toString())); + log.log(Level.WARNING, String.format("Expected the field `scaExemptionRequested` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemptionRequested").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java index dad47b9be..829ac08ca 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -272,6 +274,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataBillingAddress.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -292,32 +298,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataBillingAddress.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataBillingAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataBillingAddress` properties.", entry.getKey())); } } // validate the optional field billingAddress.city if (jsonObj.get("billingAddress.city") != null && !jsonObj.get("billingAddress.city").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.city").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.city").toString())); } // validate the optional field billingAddress.country if (jsonObj.get("billingAddress.country") != null && !jsonObj.get("billingAddress.country").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.country").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.country").toString())); } // validate the optional field billingAddress.houseNumberOrName if (jsonObj.get("billingAddress.houseNumberOrName") != null && !jsonObj.get("billingAddress.houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.houseNumberOrName").toString())); } // validate the optional field billingAddress.postalCode if (jsonObj.get("billingAddress.postalCode") != null && !jsonObj.get("billingAddress.postalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.postalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.postalCode").toString())); } // validate the optional field billingAddress.stateOrProvince if (jsonObj.get("billingAddress.stateOrProvince") != null && !jsonObj.get("billingAddress.stateOrProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.stateOrProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.stateOrProvince").toString())); } // validate the optional field billingAddress.street if (jsonObj.get("billingAddress.street") != null && !jsonObj.get("billingAddress.street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.street").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.street").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java index d5c26ade6..866ea9c21 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -330,6 +332,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataCard.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -350,40 +356,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataCard.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCard` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCard` properties.", entry.getKey())); } } // validate the optional field cardBin if (jsonObj.get("cardBin") != null && !jsonObj.get("cardBin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardBin").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardBin").toString())); } // validate the optional field cardHolderName if (jsonObj.get("cardHolderName") != null && !jsonObj.get("cardHolderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderName").toString())); } // validate the optional field cardIssuingBank if (jsonObj.get("cardIssuingBank") != null && !jsonObj.get("cardIssuingBank").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingBank").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingBank").toString())); } // validate the optional field cardIssuingCountry if (jsonObj.get("cardIssuingCountry") != null && !jsonObj.get("cardIssuingCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCountry").toString())); } // validate the optional field cardIssuingCurrency if (jsonObj.get("cardIssuingCurrency") != null && !jsonObj.get("cardIssuingCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCurrency").toString())); } // validate the optional field cardPaymentMethod if (jsonObj.get("cardPaymentMethod") != null && !jsonObj.get("cardPaymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardPaymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardPaymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardPaymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardPaymentMethod").toString())); } // validate the optional field cardSummary if (jsonObj.get("cardSummary") != null && !jsonObj.get("cardSummary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardSummary").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardSummary").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())); + log.log(Level.WARNING, String.format("Expected the field `issuerBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerBin").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java index abaef17d2..ff9f3b85c 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1905,6 +1907,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataCommon.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1925,96 +1931,96 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataCommon.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCommon` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCommon` properties.", entry.getKey())); } } // validate the optional field acquirerAccountCode if (jsonObj.get("acquirerAccountCode") != null && !jsonObj.get("acquirerAccountCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerAccountCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerAccountCode").toString())); } // validate the optional field acquirerCode if (jsonObj.get("acquirerCode") != null && !jsonObj.get("acquirerCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerCode").toString())); } // validate the optional field acquirerReference if (jsonObj.get("acquirerReference") != null && !jsonObj.get("acquirerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerReference").toString())); } // validate the optional field alias if (jsonObj.get("alias") != null && !jsonObj.get("alias").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); + log.log(Level.WARNING, String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); } // validate the optional field aliasType if (jsonObj.get("aliasType") != null && !jsonObj.get("aliasType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").toString())); + log.log(Level.WARNING, String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").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())); + log.log(Level.WARNING, 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 authorisationMid if (jsonObj.get("authorisationMid") != null && !jsonObj.get("authorisationMid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisationMid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationMid").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisationMid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationMid").toString())); } // validate the optional field authorisedAmountCurrency if (jsonObj.get("authorisedAmountCurrency") != null && !jsonObj.get("authorisedAmountCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisedAmountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisedAmountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountCurrency").toString())); } // validate the optional field authorisedAmountValue if (jsonObj.get("authorisedAmountValue") != null && !jsonObj.get("authorisedAmountValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisedAmountValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisedAmountValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountValue").toString())); } // validate the optional field avsResult if (jsonObj.get("avsResult") != null && !jsonObj.get("avsResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResult").toString())); } // validate the optional field avsResultRaw if (jsonObj.get("avsResultRaw") != null && !jsonObj.get("avsResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").toString())); } // validate the optional field coBrandedWith if (jsonObj.get("coBrandedWith") != null && !jsonObj.get("coBrandedWith").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `coBrandedWith` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coBrandedWith").toString())); + log.log(Level.WARNING, String.format("Expected the field `coBrandedWith` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coBrandedWith").toString())); } // validate the optional field cvcResult if (jsonObj.get("cvcResult") != null && !jsonObj.get("cvcResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResult").toString())); } // validate the optional field cvcResultRaw if (jsonObj.get("cvcResultRaw") != null && !jsonObj.get("cvcResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // validate the optional field expiryDate if (jsonObj.get("expiryDate") != null && !jsonObj.get("expiryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); } // validate the optional field extraCostsCurrency if (jsonObj.get("extraCostsCurrency") != null && !jsonObj.get("extraCostsCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extraCostsCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `extraCostsCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsCurrency").toString())); } // validate the optional field extraCostsValue if (jsonObj.get("extraCostsValue") != null && !jsonObj.get("extraCostsValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extraCostsValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `extraCostsValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsValue").toString())); } // validate the optional field fraudCheck-[itemNr]-[FraudCheckname] if (jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]") != null && !jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fraudCheck-[itemNr]-[FraudCheckname]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").toString())); + log.log(Level.WARNING, String.format("Expected the field `fraudCheck-[itemNr]-[FraudCheckname]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").toString())); } // validate the optional field fraudManualReview if (jsonObj.get("fraudManualReview") != null && !jsonObj.get("fraudManualReview").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fraudManualReview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudManualReview").toString())); + log.log(Level.WARNING, String.format("Expected the field `fraudManualReview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudManualReview").toString())); } // ensure the field fraudResultType can be parsed to an enum value if (jsonObj.get("fraudResultType") != null) { @@ -2025,87 +2031,87 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field fundingSource if (jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); + log.log(Level.WARNING, String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); } // validate the optional field fundsAvailability 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())); + log.log(Level.WARNING, 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 inferredRefusalReason if (jsonObj.get("inferredRefusalReason") != null && !jsonObj.get("inferredRefusalReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `inferredRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inferredRefusalReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `inferredRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inferredRefusalReason").toString())); } // validate the optional field isCardCommercial if (jsonObj.get("isCardCommercial") != null && !jsonObj.get("isCardCommercial").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `isCardCommercial` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isCardCommercial").toString())); + log.log(Level.WARNING, String.format("Expected the field `isCardCommercial` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isCardCommercial").toString())); } // validate the optional field issuerCountry if (jsonObj.get("issuerCountry") != null && !jsonObj.get("issuerCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); } // validate the optional field liabilityShift if (jsonObj.get("liabilityShift") != null && !jsonObj.get("liabilityShift").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `liabilityShift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("liabilityShift").toString())); + log.log(Level.WARNING, String.format("Expected the field `liabilityShift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("liabilityShift").toString())); } // validate the optional field mcBankNetReferenceNumber if (jsonObj.get("mcBankNetReferenceNumber") != null && !jsonObj.get("mcBankNetReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcBankNetReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcBankNetReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcBankNetReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcBankNetReferenceNumber").toString())); } // validate the optional field merchantAdviceCode if (jsonObj.get("merchantAdviceCode") != null && !jsonObj.get("merchantAdviceCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantAdviceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAdviceCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantAdviceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAdviceCode").toString())); } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field paymentAccountReference if (jsonObj.get("paymentAccountReference") != null && !jsonObj.get("paymentAccountReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAccountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccountReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAccountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccountReference").toString())); } // validate the optional field paymentMethod if (jsonObj.get("paymentMethod") != null && !jsonObj.get("paymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); } // validate the optional field paymentMethodVariant if (jsonObj.get("paymentMethodVariant") != null && !jsonObj.get("paymentMethodVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); } // validate the optional field payoutEligible if (jsonObj.get("payoutEligible") != null && !jsonObj.get("payoutEligible").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); + log.log(Level.WARNING, String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); } // validate the optional field realtimeAccountUpdaterStatus if (jsonObj.get("realtimeAccountUpdaterStatus") != null && !jsonObj.get("realtimeAccountUpdaterStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `realtimeAccountUpdaterStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realtimeAccountUpdaterStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `realtimeAccountUpdaterStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realtimeAccountUpdaterStatus").toString())); } // validate the optional field receiptFreeText if (jsonObj.get("receiptFreeText") != null && !jsonObj.get("receiptFreeText").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `receiptFreeText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptFreeText").toString())); + log.log(Level.WARNING, String.format("Expected the field `receiptFreeText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptFreeText").toString())); } // validate the optional field recurring.contractTypes if (jsonObj.get("recurring.contractTypes") != null && !jsonObj.get("recurring.contractTypes").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.contractTypes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.contractTypes").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.contractTypes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.contractTypes").toString())); } // validate the optional field recurring.firstPspReference if (jsonObj.get("recurring.firstPspReference") != null && !jsonObj.get("recurring.firstPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.firstPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.firstPspReference").toString())); } // validate the optional field recurring.recurringDetailReference if (jsonObj.get("recurring.recurringDetailReference") != null && !jsonObj.get("recurring.recurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.recurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.recurringDetailReference").toString())); } // validate the optional field recurring.shopperReference if (jsonObj.get("recurring.shopperReference") != null && !jsonObj.get("recurring.shopperReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.shopperReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.shopperReference").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2116,59 +2122,59 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field referred if (jsonObj.get("referred") != null && !jsonObj.get("referred").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `referred` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referred").toString())); + log.log(Level.WARNING, String.format("Expected the field `referred` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referred").toString())); } // validate the optional field refusalReasonRaw if (jsonObj.get("refusalReasonRaw") != null && !jsonObj.get("refusalReasonRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refusalReasonRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `refusalReasonRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonRaw").toString())); } // validate the optional field requestAmount if (jsonObj.get("requestAmount") != null && !jsonObj.get("requestAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAmount").toString())); } // validate the optional field requestCurrencyCode if (jsonObj.get("requestCurrencyCode") != null && !jsonObj.get("requestCurrencyCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestCurrencyCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestCurrencyCode").toString())); } // validate the optional field shopperInteraction if (jsonObj.get("shopperInteraction") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); } // 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())); + log.log(Level.WARNING, 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 terminalId if (jsonObj.get("terminalId") != null && !jsonObj.get("terminalId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); } // validate the optional field threeDAuthenticated if (jsonObj.get("threeDAuthenticated") != null && !jsonObj.get("threeDAuthenticated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); } // validate the optional field threeDAuthenticatedResponse if (jsonObj.get("threeDAuthenticatedResponse") != null && !jsonObj.get("threeDAuthenticatedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); } // validate the optional field threeDOffered if (jsonObj.get("threeDOffered") != null && !jsonObj.get("threeDOffered").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); } // validate the optional field threeDOfferedResponse if (jsonObj.get("threeDOfferedResponse") != null && !jsonObj.get("threeDOfferedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } // validate the optional field visaTransactionId if (jsonObj.get("visaTransactionId") != null && !jsonObj.get("visaTransactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `visaTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaTransactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `visaTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaTransactionId").toString())); } // validate the optional field xid if (jsonObj.get("xid") != null && !jsonObj.get("xid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); + log.log(Level.WARNING, String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java index 55a653b1c..40c66691d 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -446,6 +448,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataInstallments.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -466,56 +472,56 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataInstallments.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataInstallments` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataInstallments` properties.", entry.getKey())); } } // validate the optional field installmentPaymentData.installmentType if (jsonObj.get("installmentPaymentData.installmentType") != null && !jsonObj.get("installmentPaymentData.installmentType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.installmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.installmentType").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.installmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.installmentType").toString())); } // validate the optional field installmentPaymentData.option[itemNr].annualPercentageRate if (jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate") != null && !jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].annualPercentageRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].annualPercentageRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").toString())); } // validate the optional field installmentPaymentData.option[itemNr].firstInstallmentAmount if (jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount") != null && !jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].firstInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].firstInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").toString())); } // validate the optional field installmentPaymentData.option[itemNr].installmentFee if (jsonObj.get("installmentPaymentData.option[itemNr].installmentFee") != null && !jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].installmentFee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].installmentFee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").toString())); } // validate the optional field installmentPaymentData.option[itemNr].interestRate if (jsonObj.get("installmentPaymentData.option[itemNr].interestRate") != null && !jsonObj.get("installmentPaymentData.option[itemNr].interestRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].interestRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].interestRate").toString())); } // validate the optional field installmentPaymentData.option[itemNr].maximumNumberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].maximumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].maximumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].minimumNumberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].minimumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].minimumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].numberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].numberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].numberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].subsequentInstallmentAmount if (jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount") != null && !jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].subsequentInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].subsequentInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").toString())); } // validate the optional field installmentPaymentData.option[itemNr].totalAmountDue if (jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue") != null && !jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].totalAmountDue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].totalAmountDue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").toString())); } // validate the optional field installmentPaymentData.paymentOptions if (jsonObj.get("installmentPaymentData.paymentOptions") != null && !jsonObj.get("installmentPaymentData.paymentOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.paymentOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.paymentOptions").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.paymentOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.paymentOptions").toString())); } // validate the optional field installments.value if (jsonObj.get("installments.value") != null && !jsonObj.get("installments.value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installments.value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installments.value").toString())); + log.log(Level.WARNING, String.format("Expected the field `installments.value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installments.value").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java index 1531d5154..5f91cbede 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataNetworkTokens.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataNetworkTokens.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataNetworkTokens` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataNetworkTokens` properties.", entry.getKey())); } } // validate the optional field networkToken.available if (jsonObj.get("networkToken.available") != null && !jsonObj.get("networkToken.available").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.available").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.available").toString())); } // validate the optional field networkToken.bin if (jsonObj.get("networkToken.bin") != null && !jsonObj.get("networkToken.bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.bin").toString())); } // validate the optional field networkToken.tokenSummary if (jsonObj.get("networkToken.tokenSummary") != null && !jsonObj.get("networkToken.tokenSummary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.tokenSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.tokenSummary").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.tokenSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.tokenSummary").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java index 0e9f6a537..870eeeaeb 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataOpi.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataOpi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataOpi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataOpi` properties.", entry.getKey())); } } // validate the optional field opi.transToken if (jsonObj.get("opi.transToken") != null && !jsonObj.get("opi.transToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `opi.transToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.transToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `opi.transToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.transToken").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java index f55e85d9b..9fba41a71 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataSepa.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataSepa.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataSepa` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataSepa` properties.", entry.getKey())); } } // validate the optional field sepadirectdebit.dateOfSignature if (jsonObj.get("sepadirectdebit.dateOfSignature") != null && !jsonObj.get("sepadirectdebit.dateOfSignature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.dateOfSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.dateOfSignature").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.dateOfSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.dateOfSignature").toString())); } // validate the optional field sepadirectdebit.mandateId if (jsonObj.get("sepadirectdebit.mandateId") != null && !jsonObj.get("sepadirectdebit.mandateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.mandateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.mandateId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.mandateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.mandateId").toString())); } // validate the optional field sepadirectdebit.sequenceType if (jsonObj.get("sepadirectdebit.sequenceType") != null && !jsonObj.get("sepadirectdebit.sequenceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.sequenceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.sequenceType").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.sequenceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.sequenceType").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java b/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java index a2127df6e..2a5c2b19f 100644 --- a/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponsePaymentMethod.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponsePaymentMethod.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponsePaymentMethod` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponsePaymentMethod` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/RiskData.java b/src/main/java/com/adyen/model/checkout/RiskData.java index 3fc7a6382..cfffcc6fa 100644 --- a/src/main/java/com/adyen/model/checkout/RiskData.java +++ b/src/main/java/com/adyen/model/checkout/RiskData.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -225,6 +227,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RiskData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -245,16 +251,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RiskData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RiskData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RiskData` properties.", entry.getKey())); } } // validate the optional field clientData if (jsonObj.get("clientData") != null && !jsonObj.get("clientData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientData").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientData").toString())); } // validate the optional field profileReference if (jsonObj.get("profileReference") != null && !jsonObj.get("profileReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `profileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profileReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `profileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profileReference").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java b/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java index 385780308..7ec56fb58 100644 --- a/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SDKEphemPubKey.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,24 +240,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SDKEphemPubKey.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SDKEphemPubKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SDKEphemPubKey` properties.", entry.getKey())); } } // validate the optional field crv if (jsonObj.get("crv") != null && !jsonObj.get("crv").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `crv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("crv").toString())); + log.log(Level.WARNING, String.format("Expected the field `crv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("crv").toString())); } // validate the optional field kty if (jsonObj.get("kty") != null && !jsonObj.get("kty").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kty").toString())); + log.log(Level.WARNING, String.format("Expected the field `kty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kty").toString())); } // validate the optional field x if (jsonObj.get("x") != null && !jsonObj.get("x").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `x` to be a primitive type in the JSON string but got `%s`", jsonObj.get("x").toString())); + log.log(Level.WARNING, String.format("Expected the field `x` to be a primitive type in the JSON string but got `%s`", jsonObj.get("x").toString())); } // validate the optional field y if (jsonObj.get("y") != null && !jsonObj.get("y").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `y` to be a primitive type in the JSON string but got `%s`", jsonObj.get("y").toString())); + log.log(Level.WARNING, String.format("Expected the field `y` to be a primitive type in the JSON string but got `%s`", jsonObj.get("y").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java index d2b0aab72..319f360cf 100644 --- a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -368,6 +370,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("samsungPayToken"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SamsungPayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -388,7 +394,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SamsungPayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SamsungPayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SamsungPayDetails` properties.", entry.getKey())); } } @@ -400,7 +406,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -411,15 +417,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 samsungPayToken if (jsonObj.get("samsungPayToken") != null && !jsonObj.get("samsungPayToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `samsungPayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("samsungPayToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `samsungPayToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("samsungPayToken").toString())); } // validate the optional field storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/SepaDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java index c66b879d1..94913bbb0 100644 --- a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -326,6 +328,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("iban"); openapiRequiredFields.add("ownerName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SepaDirectDebitDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -346,7 +352,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SepaDirectDebitDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SepaDirectDebitDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SepaDirectDebitDetails` properties.", entry.getKey())); } } @@ -358,23 +364,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/ServiceError.java b/src/main/java/com/adyen/model/checkout/ServiceError.java index d0714904b..defcdee7c 100644 --- a/src/main/java/com/adyen/model/checkout/ServiceError.java +++ b/src/main/java/com/adyen/model/checkout/ServiceError.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -283,6 +285,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -303,24 +309,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ServiceError2.java b/src/main/java/com/adyen/model/checkout/ServiceError2.java index 8d774c7fd..b171c0ab9 100644 --- a/src/main/java/com/adyen/model/checkout/ServiceError2.java +++ b/src/main/java/com/adyen/model/checkout/ServiceError2.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError2.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,24 +240,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ServiceError2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ServiceError2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError2` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ShopperInput.java b/src/main/java/com/adyen/model/checkout/ShopperInput.java index d2566f5d6..ff7425542 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperInput.java +++ b/src/main/java/com/adyen/model/checkout/ShopperInput.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -332,6 +334,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ShopperInput.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -352,7 +358,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ShopperInput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShopperInput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ShopperInput` properties.", entry.getKey())); } } // ensure the field billingAddress can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java index 02abf3b93..9e9d09f79 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ShopperInteractionDevice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ShopperInteractionDevice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShopperInteractionDevice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ShopperInteractionDevice` properties.", entry.getKey())); } } // validate the optional field locale if (jsonObj.get("locale") != null && !jsonObj.get("locale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `locale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locale").toString())); + log.log(Level.WARNING, String.format("Expected the field `locale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locale").toString())); } // validate the optional field os if (jsonObj.get("os") != null && !jsonObj.get("os").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); + log.log(Level.WARNING, String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); } // validate the optional field osVersion if (jsonObj.get("osVersion") != null && !jsonObj.get("osVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/Split.java b/src/main/java/com/adyen/model/checkout/Split.java index 0cadec63d..f1b6562dc 100644 --- a/src/main/java/com/adyen/model/checkout/Split.java +++ b/src/main/java/com/adyen/model/checkout/Split.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -80,6 +82,18 @@ public enum TypeEnum { PAYMENTFEE("PaymentFee"), + PAYMENTFEEACQUIRING("PaymentFeeAcquiring"), + + PAYMENTFEEADYEN("PaymentFeeAdyen"), + + PAYMENTFEEADYENCOMMISSION("PaymentFeeAdyenCommission"), + + PAYMENTFEEADYENMARKUP("PaymentFeeAdyenMarkup"), + + PAYMENTFEEINTERCHANGE("PaymentFeeInterchange"), + + PAYMENTFEESCHEMEFEE("PaymentFeeSchemeFee"), + REMAINDER("Remainder"), SURCHARGE("Surcharge"), @@ -309,6 +323,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("amount"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Split.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -329,7 +347,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Split.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Split` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Split` properties.", entry.getKey())); } } @@ -341,7 +359,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field account if (jsonObj.get("account") != null && !jsonObj.get("account").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); + log.log(Level.WARNING, String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -349,11 +367,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/checkout/SplitAmount.java b/src/main/java/com/adyen/model/checkout/SplitAmount.java index 46f2f3b26..eedf4eb50 100644 --- a/src/main/java/com/adyen/model/checkout/SplitAmount.java +++ b/src/main/java/com/adyen/model/checkout/SplitAmount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SplitAmount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SplitAmount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SplitAmount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SplitAmount` properties.", entry.getKey())); } } @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResource.java b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResource.java index efee9c37d..dee96ae69 100644 --- a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResource.java +++ b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResource.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -292,6 +294,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StandalonePaymentCancelResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -312,7 +318,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StandalonePaymentCancelResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StandalonePaymentCancelResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StandalonePaymentCancelResource` properties.", entry.getKey())); } } @@ -324,19 +330,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 paymentReference if (jsonObj.get("paymentReference") != null && !jsonObj.get("paymentReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/checkout/StoredDetails.java b/src/main/java/com/adyen/model/checkout/StoredDetails.java index 6a9e4172a..2f682fa87 100644 --- a/src/main/java/com/adyen/model/checkout/StoredDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredDetails.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoredDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredDetails` properties.", entry.getKey())); } } // validate the optional field `bank` @@ -220,7 +226,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field emailAddress if (jsonObj.get("emailAddress") != null && !jsonObj.get("emailAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `emailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailAddress").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java index 13567300c..8abc7a87b 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -522,6 +524,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredPaymentMethod.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -542,64 +548,64 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoredPaymentMethod.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredPaymentMethod` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredPaymentMethod` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field lastFour if (jsonObj.get("lastFour") != null && !jsonObj.get("lastFour").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").toString())); + log.log(Level.WARNING, String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // ensure the json data is an array if (jsonObj.get("supportedRecurringProcessingModels") != null && !jsonObj.get("supportedRecurringProcessingModels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `supportedRecurringProcessingModels` to be an array in the JSON string but got `%s`", jsonObj.get("supportedRecurringProcessingModels").toString())); + log.log(Level.WARNING, String.format("Expected the field `supportedRecurringProcessingModels` to be an array in the JSON string but got `%s`", jsonObj.get("supportedRecurringProcessingModels").toString())); } // ensure the json data is an array if (jsonObj.get("supportedShopperInteractions") != null && !jsonObj.get("supportedShopperInteractions").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `supportedShopperInteractions` to be an array in the JSON string but got `%s`", jsonObj.get("supportedShopperInteractions").toString())); + log.log(Level.WARNING, String.format("Expected the field `supportedShopperInteractions` to be an array in the JSON string but got `%s`", jsonObj.get("supportedShopperInteractions").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java index 1e76e774d..854eb3202 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -298,6 +300,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredPaymentMethodDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -318,20 +324,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoredPaymentMethodDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredPaymentMethodDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredPaymentMethodDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/StoredPaymentMethodResource.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java index f04b7f368..969d108a6 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -601,6 +603,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredPaymentMethodResource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -621,76 +627,76 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoredPaymentMethodResource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoredPaymentMethodResource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredPaymentMethodResource` properties.", entry.getKey())); } } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } // validate the optional field expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // validate the optional field externalResponseCode if (jsonObj.get("externalResponseCode") != null && !jsonObj.get("externalResponseCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalResponseCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `externalResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalResponseCode").toString())); } // validate the optional field externalTokenReference if (jsonObj.get("externalTokenReference") != null && !jsonObj.get("externalTokenReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalTokenReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalTokenReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `externalTokenReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalTokenReference").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field issuerName if (jsonObj.get("issuerName") != null && !jsonObj.get("issuerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerName").toString())); } // validate the optional field lastFour if (jsonObj.get("lastFour") != null && !jsonObj.get("lastFour").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").toString())); + log.log(Level.WARNING, String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } // ensure the json data is an array if (jsonObj.get("supportedRecurringProcessingModels") != null && !jsonObj.get("supportedRecurringProcessingModels").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `supportedRecurringProcessingModels` to be an array in the JSON string but got `%s`", jsonObj.get("supportedRecurringProcessingModels").toString())); + log.log(Level.WARNING, String.format("Expected the field `supportedRecurringProcessingModels` to be an array in the JSON string but got `%s`", jsonObj.get("supportedRecurringProcessingModels").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/SubInputDetail.java b/src/main/java/com/adyen/model/checkout/SubInputDetail.java index bf6c72d0c..28ff17041 100644 --- a/src/main/java/com/adyen/model/checkout/SubInputDetail.java +++ b/src/main/java/com/adyen/model/checkout/SubInputDetail.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -293,6 +295,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubInputDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -313,7 +319,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SubInputDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubInputDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubInputDetail` properties.", entry.getKey())); } } JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); @@ -330,15 +336,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field key if (jsonObj.get("key") != null && !jsonObj.get("key").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + log.log(Level.WARNING, String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/SubMerchant.java b/src/main/java/com/adyen/model/checkout/SubMerchant.java index 54b0fc58e..cca269f9a 100644 --- a/src/main/java/com/adyen/model/checkout/SubMerchant.java +++ b/src/main/java/com/adyen/model/checkout/SubMerchant.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -243,6 +245,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubMerchant.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -263,28 +269,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SubMerchant.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubMerchant` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubMerchant` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java index 3740a6922..b8867edc0 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -1554,6 +1556,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("deviceChannel"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2RequestData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1574,7 +1580,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2RequestData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2RequestData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2RequestData` properties.", entry.getKey())); } } @@ -1597,11 +1603,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field acquirerBIN if (jsonObj.get("acquirerBIN") != null && !jsonObj.get("acquirerBIN").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerBIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerBIN").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerBIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerBIN").toString())); } // validate the optional field acquirerMerchantID if (jsonObj.get("acquirerMerchantID") != null && !jsonObj.get("acquirerMerchantID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerMerchantID").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerMerchantID").toString())); } // ensure the field addrMatch can be parsed to an enum value if (jsonObj.get("addrMatch") != null) { @@ -1619,7 +1625,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceChannel if (jsonObj.get("deviceChannel") != null && !jsonObj.get("deviceChannel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceChannel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceChannel").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceChannel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceChannel").toString())); } // validate the optional field `deviceRenderOptions` if (jsonObj.getAsJsonObject("deviceRenderOptions") != null) { @@ -1631,15 +1637,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); } // validate the optional field merchantName if (jsonObj.get("merchantName") != null && !jsonObj.get("merchantName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantName").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantName").toString())); } // validate the optional field messageVersion if (jsonObj.get("messageVersion") != null && !jsonObj.get("messageVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); } // validate the optional field `mobilePhone` if (jsonObj.getAsJsonObject("mobilePhone") != null) { @@ -1647,31 +1653,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field notificationURL if (jsonObj.get("notificationURL") != null && !jsonObj.get("notificationURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `notificationURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `notificationURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationURL").toString())); } // validate the optional field paymentAuthenticationUseCase if (jsonObj.get("paymentAuthenticationUseCase") != null && !jsonObj.get("paymentAuthenticationUseCase").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAuthenticationUseCase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAuthenticationUseCase").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAuthenticationUseCase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAuthenticationUseCase").toString())); } // validate the optional field purchaseInstalData if (jsonObj.get("purchaseInstalData") != null && !jsonObj.get("purchaseInstalData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `purchaseInstalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purchaseInstalData").toString())); + log.log(Level.WARNING, String.format("Expected the field `purchaseInstalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purchaseInstalData").toString())); } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // validate the optional field sdkAppID if (jsonObj.get("sdkAppID") != null && !jsonObj.get("sdkAppID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkAppID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkAppID").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkAppID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkAppID").toString())); } // validate the optional field sdkEncData if (jsonObj.get("sdkEncData") != null && !jsonObj.get("sdkEncData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkEncData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkEncData").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkEncData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkEncData").toString())); } // validate the optional field `sdkEphemPubKey` if (jsonObj.getAsJsonObject("sdkEphemPubKey") != null) { @@ -1679,23 +1685,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field sdkReferenceNumber if (jsonObj.get("sdkReferenceNumber") != null && !jsonObj.get("sdkReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkReferenceNumber").toString())); } // validate the optional field sdkTransID if (jsonObj.get("sdkTransID") != null && !jsonObj.get("sdkTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkTransID").toString())); } // validate the optional field sdkVersion if (jsonObj.get("sdkVersion") != null && !jsonObj.get("sdkVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkVersion").toString())); } // validate the optional field threeDSCompInd if (jsonObj.get("threeDSCompInd") != null && !jsonObj.get("threeDSCompInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSCompInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSCompInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSCompInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSCompInd").toString())); } // validate the optional field threeDSRequestorAuthenticationInd if (jsonObj.get("threeDSRequestorAuthenticationInd") != null && !jsonObj.get("threeDSRequestorAuthenticationInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorAuthenticationInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorAuthenticationInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorAuthenticationInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorAuthenticationInd").toString())); } // validate the optional field `threeDSRequestorAuthenticationInfo` if (jsonObj.getAsJsonObject("threeDSRequestorAuthenticationInfo") != null) { @@ -1710,11 +1716,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSRequestorID if (jsonObj.get("threeDSRequestorID") != null && !jsonObj.get("threeDSRequestorID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorID").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorID").toString())); } // validate the optional field threeDSRequestorName if (jsonObj.get("threeDSRequestorName") != null && !jsonObj.get("threeDSRequestorName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorName").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorName").toString())); } // validate the optional field `threeDSRequestorPriorAuthenticationInfo` if (jsonObj.getAsJsonObject("threeDSRequestorPriorAuthenticationInfo") != null) { @@ -1722,7 +1728,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSRequestorURL if (jsonObj.get("threeDSRequestorURL") != null && !jsonObj.get("threeDSRequestorURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorURL").toString())); } // ensure the field transType can be parsed to an enum value if (jsonObj.get("transType") != null) { @@ -1740,7 +1746,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field whiteListStatus if (jsonObj.get("whiteListStatus") != null && !jsonObj.get("whiteListStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); } // validate the optional field `workPhone` if (jsonObj.getAsJsonObject("workPhone") != null) { diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java index 9a433940d..96f1b204f 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -649,6 +651,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2ResponseData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -669,84 +675,84 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2ResponseData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2ResponseData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2ResponseData` properties.", entry.getKey())); } } // validate the optional field acsChallengeMandated if (jsonObj.get("acsChallengeMandated") != null && !jsonObj.get("acsChallengeMandated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acsChallengeMandated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsChallengeMandated").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsChallengeMandated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsChallengeMandated").toString())); } // validate the optional field acsOperatorID if (jsonObj.get("acsOperatorID") != null && !jsonObj.get("acsOperatorID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acsOperatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsOperatorID").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsOperatorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsOperatorID").toString())); } // validate the optional field acsReferenceNumber if (jsonObj.get("acsReferenceNumber") != null && !jsonObj.get("acsReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acsReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsReferenceNumber").toString())); } // validate the optional field acsSignedContent if (jsonObj.get("acsSignedContent") != null && !jsonObj.get("acsSignedContent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acsSignedContent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsSignedContent").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsSignedContent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsSignedContent").toString())); } // validate the optional field acsTransID if (jsonObj.get("acsTransID") != null && !jsonObj.get("acsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsTransID").toString())); } // validate the optional field acsURL if (jsonObj.get("acsURL") != null && !jsonObj.get("acsURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acsURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `acsURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acsURL").toString())); } // validate the optional field authenticationType if (jsonObj.get("authenticationType") != null && !jsonObj.get("authenticationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authenticationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationType").toString())); + log.log(Level.WARNING, String.format("Expected the field `authenticationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationType").toString())); } // validate the optional field cardHolderInfo if (jsonObj.get("cardHolderInfo") != null && !jsonObj.get("cardHolderInfo").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // validate the optional field challengeIndicator if (jsonObj.get("challengeIndicator") != null && !jsonObj.get("challengeIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `challengeIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challengeIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `challengeIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("challengeIndicator").toString())); } // validate the optional field dsReferenceNumber if (jsonObj.get("dsReferenceNumber") != null && !jsonObj.get("dsReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsReferenceNumber").toString())); } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field exemptionIndicator if (jsonObj.get("exemptionIndicator") != null && !jsonObj.get("exemptionIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `exemptionIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exemptionIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `exemptionIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exemptionIndicator").toString())); } // validate the optional field messageVersion if (jsonObj.get("messageVersion") != null && !jsonObj.get("messageVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); } // validate the optional field riskScore if (jsonObj.get("riskScore") != null && !jsonObj.get("riskScore").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); } // validate the optional field sdkEphemPubKey if (jsonObj.get("sdkEphemPubKey") != null && !jsonObj.get("sdkEphemPubKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkEphemPubKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkEphemPubKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkEphemPubKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkEphemPubKey").toString())); } // validate the optional field threeDSServerTransID if (jsonObj.get("threeDSServerTransID") != null && !jsonObj.get("threeDSServerTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSServerTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSServerTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSServerTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSServerTransID").toString())); } // validate the optional field transStatus if (jsonObj.get("transStatus") != null && !jsonObj.get("transStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatus").toString())); } // validate the optional field transStatusReason if (jsonObj.get("transStatusReason") != null && !jsonObj.get("transStatusReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java b/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java index 21413f7f3..891fbc488 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -663,6 +665,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2Result.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -683,16 +689,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2Result.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2Result` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2Result` properties.", entry.getKey())); } } // validate the optional field authenticationValue if (jsonObj.get("authenticationValue") != null && !jsonObj.get("authenticationValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authenticationValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `authenticationValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationValue").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // ensure the field challengeCancel can be parsed to an enum value if (jsonObj.get("challengeCancel") != null) { @@ -710,11 +716,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // ensure the field exemptionIndicator can be parsed to an enum value if (jsonObj.get("exemptionIndicator") != null) { @@ -725,31 +731,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field messageVersion if (jsonObj.get("messageVersion") != null && !jsonObj.get("messageVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); } // validate the optional field riskScore if (jsonObj.get("riskScore") != null && !jsonObj.get("riskScore").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); } // validate the optional field threeDSServerTransID if (jsonObj.get("threeDSServerTransID") != null && !jsonObj.get("threeDSServerTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSServerTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSServerTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSServerTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSServerTransID").toString())); } // validate the optional field timestamp if (jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + log.log(Level.WARNING, String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); } // validate the optional field transStatus if (jsonObj.get("transStatus") != null && !jsonObj.get("transStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatus").toString())); } // validate the optional field transStatusReason if (jsonObj.get("transStatusReason") != null && !jsonObj.get("transStatusReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); } // validate the optional field whiteListStatus if (jsonObj.get("whiteListStatus") != null && !jsonObj.get("whiteListStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java index bc1a9db08..64d061c65 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -406,6 +408,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSRequestData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -426,7 +432,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSRequestData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestData` properties.", entry.getKey())); } } // ensure the field challengeWindowSize can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java index 7e23e5e59..eb56f5c8d 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -240,6 +242,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSRequestorAuthenticationInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -260,12 +266,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSRequestorAuthenticationInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorAuthenticationInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorAuthenticationInfo` properties.", entry.getKey())); } } // validate the optional field threeDSReqAuthData if (jsonObj.get("threeDSReqAuthData") != null && !jsonObj.get("threeDSReqAuthData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthData").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthData").toString())); } // ensure the field threeDSReqAuthMethod can be parsed to an enum value if (jsonObj.get("threeDSReqAuthMethod") != null) { @@ -276,7 +282,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSReqAuthTimestamp if (jsonObj.get("threeDSReqAuthTimestamp") != null && !jsonObj.get("threeDSReqAuthTimestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthTimestamp").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthTimestamp").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java index b2e95ad06..5f59239b7 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -265,6 +267,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSRequestorPriorAuthenticationInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -285,12 +291,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSRequestorPriorAuthenticationInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorPriorAuthenticationInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorPriorAuthenticationInfo` properties.", entry.getKey())); } } // validate the optional field threeDSReqPriorAuthData if (jsonObj.get("threeDSReqPriorAuthData") != null && !jsonObj.get("threeDSReqPriorAuthData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqPriorAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthData").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqPriorAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthData").toString())); } // ensure the field threeDSReqPriorAuthMethod can be parsed to an enum value if (jsonObj.get("threeDSReqPriorAuthMethod") != null) { @@ -301,11 +307,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSReqPriorAuthTimestamp if (jsonObj.get("threeDSReqPriorAuthTimestamp") != null && !jsonObj.get("threeDSReqPriorAuthTimestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqPriorAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthTimestamp").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqPriorAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthTimestamp").toString())); } // validate the optional field threeDSReqPriorRef if (jsonObj.get("threeDSReqPriorRef") != null && !jsonObj.get("threeDSReqPriorRef").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqPriorRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorRef").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqPriorRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorRef").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java b/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java index d9a5b0394..c3e20a92d 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -613,6 +615,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSecureData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -633,7 +639,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSecureData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSecureData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSecureData` properties.", entry.getKey())); } } // ensure the field authenticationResponse can be parsed to an enum value @@ -645,7 +651,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // ensure the field challengeCancel can be parsed to an enum value if (jsonObj.get("challengeCancel") != null) { @@ -663,23 +669,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // validate the optional field riskScore if (jsonObj.get("riskScore") != null && !jsonObj.get("riskScore").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } // validate the optional field transStatusReason if (jsonObj.get("transStatusReason") != null && !jsonObj.get("transStatusReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java index ba019fa16..8dc95c718 100644 --- a/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -173,6 +175,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdatePaymentLinkRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -193,7 +199,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdatePaymentLinkRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePaymentLinkRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdatePaymentLinkRequest` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java index 8d5a1aff3..b93631868 100644 --- a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -353,6 +355,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("billingSequenceNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpiCollectDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpiCollectDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpiCollectDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpiCollectDetails` properties.", entry.getKey())); } } @@ -385,23 +391,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingSequenceNumber if (jsonObj.get("billingSequenceNumber") != null && !jsonObj.get("billingSequenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingSequenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingSequenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingSequenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingSequenceNumber").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 shopperNotificationReference if (jsonObj.get("shopperNotificationReference") != null && !jsonObj.get("shopperNotificationReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); } // validate the optional field storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // ensure the field type can be parsed to an enum value if (jsonObj.get("type") != null) { @@ -412,7 +418,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field virtualPaymentAddress if (jsonObj.get("virtualPaymentAddress") != null && !jsonObj.get("virtualPaymentAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `virtualPaymentAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("virtualPaymentAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `virtualPaymentAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("virtualPaymentAddress").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java index e6f728a64..928a77af1 100644 --- a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -294,6 +296,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpiIntentDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -314,7 +320,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpiIntentDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpiIntentDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpiIntentDetails` properties.", entry.getKey())); } } @@ -326,19 +332,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 shopperNotificationReference if (jsonObj.get("shopperNotificationReference") != null && !jsonObj.get("shopperNotificationReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); } // validate the optional field storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/checkout/VippsDetails.java b/src/main/java/com/adyen/model/checkout/VippsDetails.java index 2de55da0d..a04a931fc 100644 --- a/src/main/java/com/adyen/model/checkout/VippsDetails.java +++ b/src/main/java/com/adyen/model/checkout/VippsDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -294,6 +296,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("telephoneNumber"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VippsDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -314,7 +320,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!VippsDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VippsDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VippsDetails` properties.", entry.getKey())); } } @@ -326,19 +332,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // 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/checkout/VisaCheckoutDetails.java b/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java index d4d0f4234..51edec7bb 100644 --- a/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java +++ b/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -305,6 +307,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("visaCheckoutCallId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VisaCheckoutDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -325,7 +331,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!VisaCheckoutDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VisaCheckoutDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VisaCheckoutDetails` properties.", entry.getKey())); } } @@ -337,7 +343,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // ensure the field fundingSource can be parsed to an enum value if (jsonObj.get("fundingSource") != null) { @@ -355,7 +361,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field visaCheckoutCallId if (jsonObj.get("visaCheckoutCallId") != null && !jsonObj.get("visaCheckoutCallId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `visaCheckoutCallId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaCheckoutCallId").toString())); + log.log(Level.WARNING, String.format("Expected the field `visaCheckoutCallId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaCheckoutCallId").toString())); } } diff --git a/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java b/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java index 9bcf984e3..3b2429997 100644 --- a/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(WeChatPayDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,12 +229,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!WeChatPayDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WeChatPayDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `WeChatPayDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // 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/checkout/WeChatPayMiniProgramDetails.java b/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java index cabea6b04..30e49dc13 100644 --- a/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java +++ b/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -259,6 +261,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(WeChatPayMiniProgramDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -279,20 +285,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!WeChatPayMiniProgramDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WeChatPayMiniProgramDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `WeChatPayMiniProgramDetails` properties.", entry.getKey())); } } // validate the optional field appId if (jsonObj.get("appId") != null && !jsonObj.get("appId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); + log.log(Level.WARNING, String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field openid if (jsonObj.get("openid") != null && !jsonObj.get("openid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openid").toString())); + log.log(Level.WARNING, String.format("Expected the field `openid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openid").toString())); } // 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/checkout/ZipDetails.java b/src/main/java/com/adyen/model/checkout/ZipDetails.java index c404100b9..c854dbd46 100644 --- a/src/main/java/com/adyen/model/checkout/ZipDetails.java +++ b/src/main/java/com/adyen/model/checkout/ZipDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.checkout.JSON; @@ -295,6 +297,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ZipDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -315,24 +321,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ZipDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ZipDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ZipDetails` properties.", entry.getKey())); } } // validate the optional field checkoutAttemptId if (jsonObj.get("checkoutAttemptId") != null && !jsonObj.get("checkoutAttemptId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); + log.log(Level.WARNING, String.format("Expected the field `checkoutAttemptId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("checkoutAttemptId").toString())); } // validate the optional field clickAndCollect if (jsonObj.get("clickAndCollect") != null && !jsonObj.get("clickAndCollect").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clickAndCollect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clickAndCollect").toString())); + log.log(Level.WARNING, String.format("Expected the field `clickAndCollect` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clickAndCollect").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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } // 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/dataprotection/ServiceError.java b/src/main/java/com/adyen/model/dataprotection/ServiceError.java index 10e4f8d84..a457ad690 100644 --- a/src/main/java/com/adyen/model/dataprotection/ServiceError.java +++ b/src/main/java/com/adyen/model/dataprotection/ServiceError.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.dataprotection.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,24 +270,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java index f21e933b0..6f3930086 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.dataprotection.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubjectErasureByPspReferenceRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,16 +212,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubjectErasureByPspReferenceRequest` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java index 19481f7a5..3a6774f68 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.dataprotection.JSON; @@ -179,6 +181,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubjectErasureResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -199,7 +205,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubjectErasureResponse` properties.", entry.getKey())); } } // ensure the field result can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java index b53b588ef..4981c877b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bsbCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AULocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AULocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java index 5635acb0f..f48962f73 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AcceptTermsOfServiceRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AcceptTermsOfServiceRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcceptTermsOfServiceRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AcceptTermsOfServiceRequest` properties.", entry.getKey())); } } // validate the optional field acceptedBy if (jsonObj.get("acceptedBy") != null && !jsonObj.get("acceptedBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acceptedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedBy").toString())); + log.log(Level.WARNING, String.format("Expected the field `acceptedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedBy").toString())); } // validate the optional field ipAddress if (jsonObj.get("ipAddress") != null && !jsonObj.get("ipAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ipAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `ipAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipAddress").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java index d69db8764..2e06c294d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -329,6 +331,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AcceptTermsOfServiceResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -349,28 +355,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AcceptTermsOfServiceResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcceptTermsOfServiceResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AcceptTermsOfServiceResponse` properties.", entry.getKey())); } } // validate the optional field acceptedBy if (jsonObj.get("acceptedBy") != null && !jsonObj.get("acceptedBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acceptedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedBy").toString())); + log.log(Level.WARNING, String.format("Expected the field `acceptedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedBy").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field ipAddress if (jsonObj.get("ipAddress") != null && !jsonObj.get("ipAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ipAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `ipAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ipAddress").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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } // validate the optional field termsOfServiceDocumentId if (jsonObj.get("termsOfServiceDocumentId") != null && !jsonObj.get("termsOfServiceDocumentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `termsOfServiceDocumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("termsOfServiceDocumentId").toString())); + log.log(Level.WARNING, String.format("Expected the field `termsOfServiceDocumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("termsOfServiceDocumentId").toString())); } // 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/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java index 5cdb54bdb..47d269612 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalBankIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,12 +229,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalBankIdentification` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Address.java b/src/main/java/com/adyen/model/legalentitymanagement/Address.java index 3fda8e412..3f323b4ce 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Address.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Address.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("country"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,7 +299,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } @@ -305,27 +311,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } // validate the optional field street2 if (jsonObj.get("street2") != null && !jsonObj.get("street2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street2").toString())); + log.log(Level.WARNING, String.format("Expected the field `street2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street2").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java index 7e0e39a5c..3972ef17d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,12 +182,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java index 7de79e7ae..8122697b9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -254,6 +256,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("content"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Attachment.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -274,7 +280,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Attachment.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Attachment` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Attachment` properties.", entry.getKey())); } } @@ -286,19 +292,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field contentType if (jsonObj.get("contentType") != null && !jsonObj.get("contentType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString())); + log.log(Level.WARNING, String.format("Expected the field `contentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contentType").toString())); } // validate the optional field filename if (jsonObj.get("filename") != null && !jsonObj.get("filename").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); + log.log(Level.WARNING, String.format("Expected the field `filename` to be a primitive type in the JSON string but got `%s`", jsonObj.get("filename").toString())); } // validate the optional field pageName if (jsonObj.get("pageName") != null && !jsonObj.get("pageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pageName").toString())); + log.log(Level.WARNING, String.format("Expected the field `pageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pageName").toString())); } // validate the optional field pageType if (jsonObj.get("pageType") != null && !jsonObj.get("pageType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pageType").toString())); + log.log(Level.WARNING, String.format("Expected the field `pageType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pageType").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java index c836a8e68..d14a85447 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -62,9 +64,21 @@ public class BankAccountInfo { @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; + public static final String SERIALIZED_NAME_TRUSTED_SOURCE = "trustedSource"; + @SerializedName(SERIALIZED_NAME_TRUSTED_SOURCE) + private Boolean trustedSource; + public BankAccountInfo() { } + + public BankAccountInfo( + Boolean trustedSource + ) { + this(); + this.trustedSource = trustedSource; + } + public BankAccountInfo accountIdentification(BankAccountInfoAccountIdentification accountIdentification) { this.accountIdentification = accountIdentification; @@ -135,6 +149,19 @@ public void setCountryCode(String countryCode) { } + /** + * Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). + * @return trustedSource + **/ + @ApiModelProperty(value = "Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding).") + + public Boolean getTrustedSource() { + return trustedSource; + } + + + + @Override public boolean equals(Object o) { @@ -147,12 +174,13 @@ public boolean equals(Object o) { BankAccountInfo bankAccountInfo = (BankAccountInfo) o; return Objects.equals(this.accountIdentification, bankAccountInfo.accountIdentification) && Objects.equals(this.accountType, bankAccountInfo.accountType) && - Objects.equals(this.countryCode, bankAccountInfo.countryCode); + Objects.equals(this.countryCode, bankAccountInfo.countryCode) && + Objects.equals(this.trustedSource, bankAccountInfo.trustedSource); } @Override public int hashCode() { - return Objects.hash(accountIdentification, accountType, countryCode); + return Objects.hash(accountIdentification, accountType, countryCode, trustedSource); } @Override @@ -162,6 +190,7 @@ public String toString() { sb.append(" accountIdentification: ").append(toIndentedString(accountIdentification)).append("\n"); sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" trustedSource: ").append(toIndentedString(trustedSource)).append("\n"); sb.append("}"); return sb.toString(); } @@ -187,10 +216,15 @@ private String toIndentedString(Object o) { openapiFields.add("accountIdentification"); openapiFields.add("accountType"); openapiFields.add("countryCode"); + openapiFields.add("trustedSource"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccountInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -211,7 +245,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BankAccountInfo.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccountInfo` properties.", entry.getKey())); } } // validate the optional field `accountIdentification` @@ -220,11 +254,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `countryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryCode").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java index a67ef5f14..1b2a47b91 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java @@ -694,6 +694,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with AULocalAccountIdentification try { + Logger.getLogger(AULocalAccountIdentification.class.getName()).setLevel(Level.OFF); AULocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -702,6 +703,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CALocalAccountIdentification try { + Logger.getLogger(CALocalAccountIdentification.class.getName()).setLevel(Level.OFF); CALocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -710,6 +712,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CZLocalAccountIdentification try { + Logger.getLogger(CZLocalAccountIdentification.class.getName()).setLevel(Level.OFF); CZLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -718,6 +721,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with DKLocalAccountIdentification try { + Logger.getLogger(DKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); DKLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -726,6 +730,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with HULocalAccountIdentification try { + Logger.getLogger(HULocalAccountIdentification.class.getName()).setLevel(Level.OFF); HULocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -734,6 +739,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with IbanAccountIdentification try { + Logger.getLogger(IbanAccountIdentification.class.getName()).setLevel(Level.OFF); IbanAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -742,6 +748,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with NOLocalAccountIdentification try { + Logger.getLogger(NOLocalAccountIdentification.class.getName()).setLevel(Level.OFF); NOLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -750,6 +757,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with NumberAndBicAccountIdentification try { + Logger.getLogger(NumberAndBicAccountIdentification.class.getName()).setLevel(Level.OFF); NumberAndBicAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -758,6 +766,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PLLocalAccountIdentification try { + Logger.getLogger(PLLocalAccountIdentification.class.getName()).setLevel(Level.OFF); PLLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -766,6 +775,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SELocalAccountIdentification try { + Logger.getLogger(SELocalAccountIdentification.class.getName()).setLevel(Level.OFF); SELocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -774,6 +784,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UKLocalAccountIdentification try { + Logger.getLogger(UKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); UKLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -782,6 +793,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with USLocalAccountIdentification try { + Logger.getLogger(USLocalAccountIdentification.class.getName()).setLevel(Level.OFF); USLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java index 51366137d..c89b3dc5b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BirthData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BirthData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BirthData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BirthData` properties.", entry.getKey())); } } // validate the optional field dateOfBirth if (jsonObj.get("dateOfBirth") != null && !jsonObj.get("dateOfBirth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dateOfBirth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfBirth").toString())); + log.log(Level.WARNING, String.format("Expected the field `dateOfBirth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfBirth").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java index 813a647f9..3d0843383 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -475,6 +477,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("legalEntityId"); openapiRequiredFields.add("service"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BusinessLine.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -495,7 +501,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BusinessLine.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BusinessLine` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BusinessLine` properties.", entry.getKey())); } } @@ -507,19 +513,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field industryCode if (jsonObj.get("industryCode") != null && !jsonObj.get("industryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `industryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `industryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industryCode").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, 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) { @@ -535,7 +541,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java index 15f1e214e..1ddff277b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -408,6 +410,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("legalEntityId"); openapiRequiredFields.add("service"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BusinessLineInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -428,7 +434,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BusinessLineInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BusinessLineInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BusinessLineInfo` properties.", entry.getKey())); } } @@ -440,19 +446,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); } // validate the optional field industryCode if (jsonObj.get("industryCode") != null && !jsonObj.get("industryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `industryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `industryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industryCode").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index 6f89b4c8c..fdc03cfa0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -406,6 +408,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("service"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BusinessLineInfoUpdate.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -426,7 +432,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BusinessLineInfoUpdate.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BusinessLineInfoUpdate` properties.", entry.getKey())); } } @@ -438,19 +444,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); } // validate the optional field industryCode if (jsonObj.get("industryCode") != null && !jsonObj.get("industryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `industryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `industryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("industryCode").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java index 9aaf37107..138d19ddd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -136,6 +138,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("businessLines"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BusinessLines.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -156,7 +162,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BusinessLines.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BusinessLines` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BusinessLines` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java index 3ef27a2dc..83f187f4c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -339,6 +341,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("transitNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CALocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -359,7 +365,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CALocalAccountIdentification` properties.", entry.getKey())); } } @@ -371,7 +377,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -382,11 +388,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java index 1515efc2c..ca3bb6d7d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bankCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CZLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CZLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java index 13bf6b4f0..9083abed4 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapabilityProblem.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CapabilityProblem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapabilityProblem` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapabilityProblem` properties.", entry.getKey())); } } // validate the optional field `entity` diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java index 5aacc7da1..204a660ca 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -274,6 +276,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapabilityProblemEntity.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -294,16 +300,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CapabilityProblemEntity.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapabilityProblemEntity` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `owner` if (jsonObj.getAsJsonObject("owner") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java index 2c8790700..0b9d7fefe 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapabilityProblemEntityRecursive.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,16 +270,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CapabilityProblemEntityRecursive.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapabilityProblemEntityRecursive` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // 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/CapabilitySettings.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java index f06f5ddd1..60b7c1510 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -362,6 +364,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapabilitySettings.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -382,12 +388,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CapabilitySettings.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CapabilitySettings` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapabilitySettings` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `fundingSource` to be an array in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); + log.log(Level.WARNING, String.format("Expected the field `fundingSource` to be an array in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); } // ensure the field interval can be parsed to an enum value if (jsonObj.get("interval") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java index 199ef9dad..0a543f751 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bankCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DKLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DKLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index c9208b799..835faf120 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -558,6 +560,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("owner"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Document.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -578,7 +584,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Document.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Document` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Document` properties.", entry.getKey())); } } @@ -606,31 +612,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 expiryDate if (jsonObj.get("expiryDate") != null && !jsonObj.get("expiryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); } // validate the optional field fileName if (jsonObj.get("fileName") != null && !jsonObj.get("fileName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileName").toString())); + log.log(Level.WARNING, String.format("Expected the field `fileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileName").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field issuerCountry if (jsonObj.get("issuerCountry") != null && !jsonObj.get("issuerCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); } // validate the optional field issuerState if (jsonObj.get("issuerState") != null && !jsonObj.get("issuerState").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerState").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerState").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // validate the optional field `owner` if (jsonObj.getAsJsonObject("owner") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java index acc696eec..2a2d7076e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DocumentReference.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,24 +299,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DocumentReference.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DocumentReference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DocumentReference` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 fileName if (jsonObj.get("fileName") != null && !jsonObj.get("fileName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileName").toString())); + log.log(Level.WARNING, String.format("Expected the field `fileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileName").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java index b87a5ea25..6c8c7db06 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(EntityReference.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!EntityReference.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EntityReference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `EntityReference` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java index 505345337..4ef661cfe 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GeneratePciDescriptionRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GeneratePciDescriptionRequest` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java index d44ac3a88..1d1582dcb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -195,6 +197,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GeneratePciDescriptionResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -215,16 +221,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GeneratePciDescriptionResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `pciTemplateReferences` to be an array in the JSON string but got `%s`", jsonObj.get("pciTemplateReferences").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java index 8771369cd..fc8a7e52d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetPciQuestionnaireInfosResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetPciQuestionnaireInfosResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java index 0dcf78c65..be1049bd7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -215,6 +217,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetPciQuestionnaireResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -235,12 +241,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetPciQuestionnaireResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java index d54826cfe..a3f42ff82 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTermsOfServiceAcceptanceInfosResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GetTermsOfServiceAcceptanceInfosResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTermsOfServiceAcceptanceInfosResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTermsOfServiceAcceptanceInfosResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java index c2ff2a26f..c2e4c6f46 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -213,6 +215,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTermsOfServiceDocumentRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -233,12 +239,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GetTermsOfServiceDocumentRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTermsOfServiceDocumentRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTermsOfServiceDocumentRequest` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } // 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/GetTermsOfServiceDocumentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java index b2329e2b1..19b8ddf5f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -300,6 +302,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTermsOfServiceDocumentResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -320,20 +326,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GetTermsOfServiceDocumentResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GetTermsOfServiceDocumentResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTermsOfServiceDocumentResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } // validate the optional field termsOfServiceDocumentId if (jsonObj.get("termsOfServiceDocumentId") != null && !jsonObj.get("termsOfServiceDocumentId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `termsOfServiceDocumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("termsOfServiceDocumentId").toString())); + log.log(Level.WARNING, String.format("Expected the field `termsOfServiceDocumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("termsOfServiceDocumentId").toString())); } // 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/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java index 8e3520dec..7c1785ab4 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(HULocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `HULocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java index 45d9e0048..3b5fd3c6e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("iban"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IbanAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java index 9f1503f7e..1215a425c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -381,6 +383,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IdentificationData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -401,7 +407,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!IdentificationData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdentificationData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IdentificationData` properties.", entry.getKey())); } } @@ -413,23 +419,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cardNumber if (jsonObj.get("cardNumber") != null && !jsonObj.get("cardNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardNumber").toString())); } // validate the optional field expiryDate if (jsonObj.get("expiryDate") != null && !jsonObj.get("expiryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); } // validate the optional field issuerCountry if (jsonObj.get("issuerCountry") != null && !jsonObj.get("issuerCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); } // validate the optional field issuerState if (jsonObj.get("issuerState") != null && !jsonObj.get("issuerState").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerState").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerState").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // 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/Individual.java b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java index ca91d914f..8d4e61bfb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -378,6 +380,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("residentialAddress"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Individual.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -398,7 +404,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Individual.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Individual` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Individual` properties.", entry.getKey())); } } @@ -414,7 +420,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field `identificationData` if (jsonObj.getAsJsonObject("identificationData") != null) { @@ -426,7 +432,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field nationality if (jsonObj.get("nationality") != null && !jsonObj.get("nationality").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); + log.log(Level.WARNING, String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); } // validate the optional field `phone` if (jsonObj.getAsJsonObject("phone") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java index e4c825392..4c9546984 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java @@ -53,6 +53,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -535,6 +537,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LegalEntity.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -555,7 +561,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LegalEntity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LegalEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LegalEntity` properties.", entry.getKey())); } } @@ -603,7 +609,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `individual` if (jsonObj.getAsJsonObject("individual") != null) { @@ -627,7 +633,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `soleProprietorship` if (jsonObj.getAsJsonObject("soleProprietorship") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java index 3f4c67021..56d9afbf5 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -314,6 +316,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("legalEntityId"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LegalEntityAssociation.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -334,7 +340,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LegalEntityAssociation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LegalEntityAssociation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LegalEntityAssociation` properties.", entry.getKey())); } } @@ -346,23 +352,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field associatorId if (jsonObj.get("associatorId") != null && !jsonObj.get("associatorId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `associatorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("associatorId").toString())); + log.log(Level.WARNING, String.format("Expected the field `associatorId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("associatorId").toString())); } // validate the optional field entityType if (jsonObj.get("entityType") != null && !jsonObj.get("entityType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `entityType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entityType").toString())); + log.log(Level.WARNING, String.format("Expected the field `entityType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entityType").toString())); } // validate the optional field jobTitle if (jsonObj.get("jobTitle") != null && !jsonObj.get("jobTitle").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `jobTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jobTitle").toString())); + log.log(Level.WARNING, String.format("Expected the field `jobTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jobTitle").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // 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 9589f8d92..07f0b494a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -400,6 +402,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LegalEntityCapability.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -420,7 +426,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LegalEntityCapability.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LegalEntityCapability` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LegalEntityCapability` properties.", entry.getKey())); } } // ensure the field allowedLevel can be parsed to an enum value @@ -459,7 +465,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field verificationStatus if (jsonObj.get("verificationStatus") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `verificationStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationStatus").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java index acd1ba720..500e82942 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -370,6 +372,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LegalEntityInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -390,7 +396,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LegalEntityInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LegalEntityInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LegalEntityInfo` properties.", entry.getKey())); } } JsonArray jsonArrayentityAssociations = jsonObj.getAsJsonArray("entityAssociations"); @@ -415,7 +421,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `soleProprietorship` if (jsonObj.getAsJsonObject("soleProprietorship") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java index 29f76f7ff..4be320a14 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -371,6 +373,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LegalEntityInfoRequiredType.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -391,7 +397,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LegalEntityInfoRequiredType.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LegalEntityInfoRequiredType` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LegalEntityInfoRequiredType` properties.", entry.getKey())); } } @@ -423,7 +429,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `soleProprietorship` if (jsonObj.getAsJsonObject("soleProprietorship") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java index 5b2d8a3ab..5d85319bf 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NOLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NOLocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Name.java b/src/main/java/com/adyen/model/legalentitymanagement/Name.java index e97ae9d54..fe55575ef 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Name.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Name.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -219,15 +225,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 infix if (jsonObj.get("infix") != null && !jsonObj.get("infix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `infix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("infix").toString())); + log.log(Level.WARNING, String.format("Expected the field `infix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("infix").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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java index 9d6cd9e68..f438e54af 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -263,6 +265,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bic"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NumberAndBicAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -283,7 +289,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NumberAndBicAccountIdentification` properties.", entry.getKey())); } } @@ -295,7 +301,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -303,7 +309,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java index a02eed945..3e98859a0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OnboardingLink.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OnboardingLink.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingLink` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OnboardingLink` properties.", entry.getKey())); } } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java index 508fe939f..baec93e18 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -225,6 +227,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OnboardingLinkInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -245,20 +251,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OnboardingLinkInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingLinkInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OnboardingLinkInfo` properties.", entry.getKey())); } } // validate the optional field locale if (jsonObj.get("locale") != null && !jsonObj.get("locale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `locale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locale").toString())); + log.log(Level.WARNING, String.format("Expected the field `locale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locale").toString())); } // validate the optional field redirectUrl if (jsonObj.get("redirectUrl") != null && !jsonObj.get("redirectUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `redirectUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `redirectUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirectUrl").toString())); } // validate the optional field themeId if (jsonObj.get("themeId") != null && !jsonObj.get("themeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `themeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("themeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `themeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("themeId").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java index da010f203..e853f4156 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -255,6 +257,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("properties"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OnboardingTheme.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -275,7 +281,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OnboardingTheme.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingTheme` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OnboardingTheme` properties.", entry.getKey())); } } @@ -287,11 +293,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java index 2c2e3366a..9a326e332 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -194,6 +196,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("themes"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OnboardingThemes.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -214,7 +220,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OnboardingThemes.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OnboardingThemes` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OnboardingThemes` properties.", entry.getKey())); } } @@ -226,11 +232,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field next if (jsonObj.get("next") != null && !jsonObj.get("next").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + log.log(Level.WARNING, String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); } // validate the optional field previous if (jsonObj.get("previous") != null && !jsonObj.get("previous").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `previous` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previous").toString())); + log.log(Level.WARNING, String.format("Expected the field `previous` to be a primitive type in the JSON string but got `%s`", jsonObj.get("previous").toString())); } JsonArray jsonArraythemes = jsonObj.getAsJsonArray("themes"); if (jsonArraythemes != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java index 5f4bec67d..58ca09e2d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java @@ -48,6 +48,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -682,6 +684,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("legalName"); openapiRequiredFields.add("registeredAddress"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Organization.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -702,7 +708,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Organization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Organization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Organization` properties.", entry.getKey())); } } @@ -714,23 +720,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dateOfIncorporation if (jsonObj.get("dateOfIncorporation") != null && !jsonObj.get("dateOfIncorporation").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dateOfIncorporation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfIncorporation").toString())); + log.log(Level.WARNING, String.format("Expected the field `dateOfIncorporation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfIncorporation").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())); + log.log(Level.WARNING, 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 doingBusinessAs if (jsonObj.get("doingBusinessAs") != null && !jsonObj.get("doingBusinessAs").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `doingBusinessAs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doingBusinessAs").toString())); + log.log(Level.WARNING, String.format("Expected the field `doingBusinessAs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doingBusinessAs").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field legalName if (jsonObj.get("legalName") != null && !jsonObj.get("legalName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `legalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalName").toString())); + log.log(Level.WARNING, String.format("Expected the field `legalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalName").toString())); } // validate the optional field `phone` if (jsonObj.getAsJsonObject("phone") != null) { @@ -746,7 +752,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field registrationNumber if (jsonObj.get("registrationNumber") != null && !jsonObj.get("registrationNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `registrationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registrationNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `registrationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registrationNumber").toString())); } // validate the optional field `stockData` if (jsonObj.getAsJsonObject("stockData") != null) { @@ -784,7 +790,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field vatNumber if (jsonObj.get("vatNumber") != null && !jsonObj.get("vatNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `vatNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vatNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `vatNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vatNumber").toString())); } // validate the optional field `webData` if (jsonObj.getAsJsonObject("webData") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java index 82da1c073..db51b8e22 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OwnerEntity.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OwnerEntity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OwnerEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OwnerEntity` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java index 22763950c..3b45b75c8 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PLLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PLLocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java index 8c52093b6..f19e9ad44 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PciDocumentInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,12 +212,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PciDocumentInfo` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java index 6f8192242..a67f67d50 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -165,6 +167,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pciTemplateReferences"); openapiRequiredFields.add("signedBy"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PciSigningRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -185,7 +191,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PciSigningRequest` properties.", entry.getKey())); } } @@ -197,11 +203,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `signedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedBy").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java index 73ad427f9..cc2b55415 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -166,6 +168,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PciSigningResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -186,16 +192,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PciSigningResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `signedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signedBy").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java index 74b6de7f9..aeaad6bed 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("number"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PhoneNumber.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PhoneNumber.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PhoneNumber` properties.", entry.getKey())); } } @@ -189,11 +195,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java index 16c6764a1..59bc7a81b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RemediatingAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RemediatingAction` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java index 9796c0971..daedc3d31 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("clearingNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SELocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SELocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java index f4e5d64d1..e68abcf25 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -243,6 +245,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -263,24 +269,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java index 81fd31425..8508e73ee 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -410,6 +412,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("registeredAddress"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SoleProprietorship.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -430,7 +436,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SoleProprietorship.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SoleProprietorship` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SoleProprietorship` properties.", entry.getKey())); } } @@ -442,19 +448,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field countryOfGoverningLaw if (jsonObj.get("countryOfGoverningLaw") != null && !jsonObj.get("countryOfGoverningLaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `countryOfGoverningLaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryOfGoverningLaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `countryOfGoverningLaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryOfGoverningLaw").toString())); } // validate the optional field dateOfIncorporation if (jsonObj.get("dateOfIncorporation") != null && !jsonObj.get("dateOfIncorporation").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dateOfIncorporation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfIncorporation").toString())); + log.log(Level.WARNING, String.format("Expected the field `dateOfIncorporation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfIncorporation").toString())); } // validate the optional field doingBusinessAs if (jsonObj.get("doingBusinessAs") != null && !jsonObj.get("doingBusinessAs").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `doingBusinessAs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doingBusinessAs").toString())); + log.log(Level.WARNING, String.format("Expected the field `doingBusinessAs` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doingBusinessAs").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field `principalPlaceOfBusiness` if (jsonObj.getAsJsonObject("principalPlaceOfBusiness") != null) { @@ -466,7 +472,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field registrationNumber if (jsonObj.get("registrationNumber") != null && !jsonObj.get("registrationNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `registrationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registrationNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `registrationNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registrationNumber").toString())); } // ensure the field vatAbsenceReason can be parsed to an enum value if (jsonObj.get("vatAbsenceReason") != null) { @@ -477,7 +483,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field vatNumber if (jsonObj.get("vatNumber") != null && !jsonObj.get("vatNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `vatNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vatNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `vatNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("vatNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java index ee801a586..b4654e5c9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -264,6 +266,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SourceOfFunds.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -284,16 +290,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SourceOfFunds.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SourceOfFunds` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SourceOfFunds` properties.", entry.getKey())); } } // validate the optional field acquiringBusinessLineId if (jsonObj.get("acquiringBusinessLineId") != null && !jsonObj.get("acquiringBusinessLineId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquiringBusinessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquiringBusinessLineId").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquiringBusinessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquiringBusinessLineId").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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // 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/StockData.java b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java index 08b4342d7..8ef1cba68 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StockData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StockData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StockData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StockData` properties.", entry.getKey())); } } // validate the optional field marketIdentifier if (jsonObj.get("marketIdentifier") != null && !jsonObj.get("marketIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `marketIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("marketIdentifier").toString())); + log.log(Level.WARNING, String.format("Expected the field `marketIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("marketIdentifier").toString())); } // validate the optional field stockNumber if (jsonObj.get("stockNumber") != null && !jsonObj.get("stockNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `stockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stockNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `stockNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stockNumber").toString())); } // validate the optional field tickerSymbol if (jsonObj.get("tickerSymbol") != null && !jsonObj.get("tickerSymbol").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tickerSymbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tickerSymbol").toString())); + log.log(Level.WARNING, String.format("Expected the field `tickerSymbol` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tickerSymbol").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java index 87bbff865..0ab97ccf1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -192,6 +194,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SupportingEntityCapability.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -212,16 +218,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SupportingEntityCapability.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SupportingEntityCapability` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SupportingEntityCapability` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field verificationStatus if (jsonObj.get("verificationStatus") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `verificationStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationStatus").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java index 083d8d099..f83804526 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TaxInformation.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TaxInformation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaxInformation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TaxInformation` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java index daf26b6a3..435742d71 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -373,6 +375,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TaxReportingClassification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -393,7 +399,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TaxReportingClassification.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TaxReportingClassification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TaxReportingClassification` properties.", entry.getKey())); } } // ensure the field businessType can be parsed to an enum value @@ -405,7 +411,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field financialInstitutionNumber if (jsonObj.get("financialInstitutionNumber") != null && !jsonObj.get("financialInstitutionNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `financialInstitutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("financialInstitutionNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `financialInstitutionNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("financialInstitutionNumber").toString())); } // ensure the field mainSourceOfIncome can be parsed to an enum value if (jsonObj.get("mainSourceOfIncome") != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java index 831ab379a..b6a1e47e1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -301,6 +303,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TermsOfServiceAcceptanceInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -321,20 +327,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TermsOfServiceAcceptanceInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TermsOfServiceAcceptanceInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TermsOfServiceAcceptanceInfo` properties.", entry.getKey())); } } // validate the optional field acceptedBy if (jsonObj.get("acceptedBy") != null && !jsonObj.get("acceptedBy").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acceptedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedBy").toString())); + log.log(Level.WARNING, String.format("Expected the field `acceptedBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedBy").toString())); } // validate the optional field acceptedFor if (jsonObj.get("acceptedFor") != null && !jsonObj.get("acceptedFor").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acceptedFor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedFor").toString())); + log.log(Level.WARNING, String.format("Expected the field `acceptedFor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptedFor").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // 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/TransferInstrument.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java index 619f14984..36e362a38 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java @@ -48,6 +48,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -383,6 +385,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("legalEntityId"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferInstrument.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -403,7 +409,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransferInstrument.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInstrument` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferInstrument` properties.", entry.getKey())); } } @@ -431,11 +437,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java index 8f0c8f1e3..6e7c25467 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -236,6 +238,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("legalEntityId"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferInstrumentInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -256,7 +262,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransferInstrumentInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInstrumentInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferInstrumentInfo` properties.", entry.getKey())); } } @@ -272,7 +278,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } // 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/TransferInstrumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java index 0a676b52c..c90374663 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -142,10 +144,10 @@ public void setRealLastFour(String realLastFour) { /** - * Identifies if the TI was created from a trusted source. + * Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding). * @return trustedSource **/ - @ApiModelProperty(value = "Identifies if the TI was created from a trusted source.") + @ApiModelProperty(value = "Identifies if the bank account was created through [instant bank verification](https://docs.adyen.com/release-notes/platforms-and-financial-products#releaseNote=2023-05-08-hosted-onboarding).") public Boolean getTrustedSource() { return trustedSource; @@ -215,6 +217,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountIdentifier"); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferInstrumentReference.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransferInstrumentReference.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInstrumentReference` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferInstrumentReference` properties.", entry.getKey())); } } @@ -247,15 +253,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field accountIdentifier if (jsonObj.get("accountIdentifier") != null && !jsonObj.get("accountIdentifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountIdentifier").toString())); + log.log(Level.WARNING, String.format("Expected the field `accountIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountIdentifier").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `realLastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realLastFour").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java index f28cbef05..3da6b90bf 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("sortCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UKLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UKLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java index ecc8175c4..fbda30a92 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -309,6 +311,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("routingNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(USLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -329,7 +335,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties.", entry.getKey())); } } @@ -341,7 +347,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -352,7 +358,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java index 3ad3c6c2b..d7d092a4b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -492,6 +494,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VerificationError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -512,20 +518,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VerificationError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } JsonArray jsonArrayremediatingActions = jsonObj.getAsJsonArray("remediatingActions"); if (jsonArrayremediatingActions != null) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java index 796081d21..070b3f70c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -454,6 +456,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VerificationErrorRecursive.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -474,20 +480,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VerificationErrorRecursive` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `capabilities` to be an array in the JSON string but got `%s`", jsonObj.get("capabilities").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // 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/VerificationErrors.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java index 7bd8bd094..84102592e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VerificationErrors.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VerificationErrors` properties.", entry.getKey())); } } JsonArray jsonArrayproblems = jsonObj.getAsJsonArray("problems"); diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java index 4d63fda88..f36bff96f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -155,6 +157,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(WebData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -175,16 +181,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!WebData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `WebData` properties.", entry.getKey())); } } // validate the optional field webAddress if (jsonObj.get("webAddress") != null && !jsonObj.get("webAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); } // validate the optional field webAddressId if (jsonObj.get("webAddressId") != null && !jsonObj.get("webAddressId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `webAddressId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddressId").toString())); + log.log(Level.WARNING, String.format("Expected the field `webAddressId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddressId").toString())); } } diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java index 7381e768b..76470e341 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.legalentitymanagement.JSON; @@ -172,6 +174,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(WebDataExemption.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -192,7 +198,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!WebDataExemption.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebDataExemption` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `WebDataExemption` properties.", entry.getKey())); } } // ensure the field reason can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/management/AdditionalSettings.java b/src/main/java/com/adyen/model/management/AdditionalSettings.java index 310fa6a6f..398a7713b 100644 --- a/src/main/java/com/adyen/model/management/AdditionalSettings.java +++ b/src/main/java/com/adyen/model/management/AdditionalSettings.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -176,6 +178,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalSettings.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -196,12 +202,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalSettings.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalSettings` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalSettings` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("includeEventCodes") != null && !jsonObj.get("includeEventCodes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `includeEventCodes` to be an array in the JSON string but got `%s`", jsonObj.get("includeEventCodes").toString())); + log.log(Level.WARNING, String.format("Expected the field `includeEventCodes` to be an array in the JSON string but got `%s`", jsonObj.get("includeEventCodes").toString())); } } diff --git a/src/main/java/com/adyen/model/management/AdditionalSettingsResponse.java b/src/main/java/com/adyen/model/management/AdditionalSettingsResponse.java index 24f5fb43f..064af29b9 100644 --- a/src/main/java/com/adyen/model/management/AdditionalSettingsResponse.java +++ b/src/main/java/com/adyen/model/management/AdditionalSettingsResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -213,6 +215,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalSettingsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -233,16 +239,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalSettingsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalSettingsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalSettingsResponse` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("excludeEventCodes") != null && !jsonObj.get("excludeEventCodes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `excludeEventCodes` to be an array in the JSON string but got `%s`", jsonObj.get("excludeEventCodes").toString())); + log.log(Level.WARNING, String.format("Expected the field `excludeEventCodes` to be an array in the JSON string but got `%s`", jsonObj.get("excludeEventCodes").toString())); } // ensure the json data is an array if (jsonObj.get("includeEventCodes") != null && !jsonObj.get("includeEventCodes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `includeEventCodes` to be an array in the JSON string but got `%s`", jsonObj.get("includeEventCodes").toString())); + log.log(Level.WARNING, String.format("Expected the field `includeEventCodes` to be an array in the JSON string but got `%s`", jsonObj.get("includeEventCodes").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Address.java b/src/main/java/com/adyen/model/management/Address.java index 9b99a5819..8d0049398 100644 --- a/src/main/java/com/adyen/model/management/Address.java +++ b/src/main/java/com/adyen/model/management/Address.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -301,6 +303,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -321,36 +327,36 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 companyName if (jsonObj.get("companyName") != null && !jsonObj.get("companyName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyName").toString())); + log.log(Level.WARNING, String.format("Expected the field `companyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyName").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `streetAddress2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("streetAddress2").toString())); } } diff --git a/src/main/java/com/adyen/model/management/AfterpayTouchInfo.java b/src/main/java/com/adyen/model/management/AfterpayTouchInfo.java new file mode 100644 index 000000000..0f4ffe897 --- /dev/null +++ b/src/main/java/com/adyen/model/management/AfterpayTouchInfo.java @@ -0,0 +1,222 @@ +/* + * 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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.management.JSON; + +/** + * AfterpayTouchInfo + */ + +public class AfterpayTouchInfo { + public static final String SERIALIZED_NAME_SUPPORT_URL = "supportUrl"; + @SerializedName(SERIALIZED_NAME_SUPPORT_URL) + private String supportUrl; + + public AfterpayTouchInfo() { + } + + public AfterpayTouchInfo supportUrl(String supportUrl) { + + this.supportUrl = supportUrl; + return this; + } + + /** + * Support Url + * @return supportUrl + **/ + @ApiModelProperty(required = true, value = "Support Url") + + public String getSupportUrl() { + return supportUrl; + } + + + public void setSupportUrl(String supportUrl) { + this.supportUrl = supportUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AfterpayTouchInfo afterpayTouchInfo = (AfterpayTouchInfo) o; + return Objects.equals(this.supportUrl, afterpayTouchInfo.supportUrl); + } + + @Override + public int hashCode() { + return Objects.hash(supportUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AfterpayTouchInfo {\n"); + sb.append(" supportUrl: ").append(toIndentedString(supportUrl)).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("supportUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("supportUrl"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AfterpayTouchInfo.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AfterpayTouchInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AfterpayTouchInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AfterpayTouchInfo is not found in the empty JSON string", AfterpayTouchInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AfterpayTouchInfo.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AfterpayTouchInfo` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AfterpayTouchInfo.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 supportUrl + if (jsonObj.get("supportUrl") != null && !jsonObj.get("supportUrl").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `supportUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AfterpayTouchInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AfterpayTouchInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AfterpayTouchInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AfterpayTouchInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AfterpayTouchInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AfterpayTouchInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of AfterpayTouchInfo + * @throws IOException if the JSON string is invalid with respect to AfterpayTouchInfo + */ + public static AfterpayTouchInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AfterpayTouchInfo.class); + } + + /** + * Convert an instance of AfterpayTouchInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/management/AllowedOrigin.java b/src/main/java/com/adyen/model/management/AllowedOrigin.java index 7f7949fa6..b186e806f 100644 --- a/src/main/java/com/adyen/model/management/AllowedOrigin.java +++ b/src/main/java/com/adyen/model/management/AllowedOrigin.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("domain"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AllowedOrigin.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AllowedOrigin.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllowedOrigin` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AllowedOrigin` properties.", entry.getKey())); } } @@ -223,11 +229,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field domain if (jsonObj.get("domain") != null && !jsonObj.get("domain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString())); + log.log(Level.WARNING, String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } diff --git a/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java b/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java index 118ad568b..929ea5f73 100644 --- a/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java +++ b/src/main/java/com/adyen/model/management/AllowedOriginsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AllowedOriginsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AllowedOriginsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AllowedOriginsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AllowedOriginsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/Amount.java b/src/main/java/com/adyen/model/management/Amount.java index dc0476b65..df04dab00 100644 --- a/src/main/java/com/adyen/model/management/Amount.java +++ b/src/main/java/com/adyen/model/management/Amount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/management/AndroidApp.java b/src/main/java/com/adyen/model/management/AndroidApp.java index 6daf80729..6df9b17e0 100644 --- a/src/main/java/com/adyen/model/management/AndroidApp.java +++ b/src/main/java/com/adyen/model/management/AndroidApp.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -303,6 +305,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AndroidApp.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -323,7 +329,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AndroidApp.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidApp` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AndroidApp` properties.", entry.getKey())); } } @@ -335,27 +341,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field label if (jsonObj.get("label") != null && !jsonObj.get("label").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("label").toString())); + log.log(Level.WARNING, String.format("Expected the field `label` to be a primitive type in the JSON string but got `%s`", jsonObj.get("label").toString())); } // validate the optional field packageName if (jsonObj.get("packageName") != null && !jsonObj.get("packageName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").toString())); + log.log(Level.WARNING, String.format("Expected the field `packageName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("packageName").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())); + log.log(Level.WARNING, 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 versionName if (jsonObj.get("versionName") != null && !jsonObj.get("versionName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `versionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("versionName").toString())); + log.log(Level.WARNING, String.format("Expected the field `versionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("versionName").toString())); } } diff --git a/src/main/java/com/adyen/model/management/AndroidAppsResponse.java b/src/main/java/com/adyen/model/management/AndroidAppsResponse.java index 63d9d5b6a..e0ee0cfd7 100644 --- a/src/main/java/com/adyen/model/management/AndroidAppsResponse.java +++ b/src/main/java/com/adyen/model/management/AndroidAppsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AndroidAppsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AndroidAppsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidAppsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AndroidAppsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/AndroidCertificate.java b/src/main/java/com/adyen/model/management/AndroidCertificate.java index 7e8278e50..13df45243 100644 --- a/src/main/java/com/adyen/model/management/AndroidCertificate.java +++ b/src/main/java/com/adyen/model/management/AndroidCertificate.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -303,6 +305,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AndroidCertificate.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -323,7 +329,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AndroidCertificate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidCertificate` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AndroidCertificate` properties.", entry.getKey())); } } @@ -335,23 +341,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 extension if (jsonObj.get("extension") != null && !jsonObj.get("extension").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extension").toString())); + log.log(Level.WARNING, String.format("Expected the field `extension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extension").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } diff --git a/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java b/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java index 4d9d0344c..72a03a525 100644 --- a/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java +++ b/src/main/java/com/adyen/model/management/AndroidCertificatesResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AndroidCertificatesResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AndroidCertificatesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AndroidCertificatesResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AndroidCertificatesResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/ApiCredential.java b/src/main/java/com/adyen/model/management/ApiCredential.java index 14a371113..90eea4043 100644 --- a/src/main/java/com/adyen/model/management/ApiCredential.java +++ b/src/main/java/com/adyen/model/management/ApiCredential.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -387,6 +389,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("roles"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApiCredential.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -407,7 +413,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApiCredential.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiCredential` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApiCredential` properties.", entry.getKey())); } } @@ -423,7 +429,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("allowedIpAddresses") != null && !jsonObj.get("allowedIpAddresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); } JsonArray jsonArrayallowedOrigins = jsonObj.getAsJsonArray("allowedOrigins"); if (jsonArrayallowedOrigins != null) { @@ -439,23 +445,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ApiCredentialLinks.java b/src/main/java/com/adyen/model/management/ApiCredentialLinks.java index f6f2eb0f9..5d6a083f4 100644 --- a/src/main/java/com/adyen/model/management/ApiCredentialLinks.java +++ b/src/main/java/com/adyen/model/management/ApiCredentialLinks.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -274,6 +276,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("self"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApiCredentialLinks.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -294,7 +300,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApiCredentialLinks.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApiCredentialLinks` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApiCredentialLinks` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ApplePayInfo.java b/src/main/java/com/adyen/model/management/ApplePayInfo.java index a86148ee5..8a287208e 100644 --- a/src/main/java/com/adyen/model/management/ApplePayInfo.java +++ b/src/main/java/com/adyen/model/management/ApplePayInfo.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApplePayInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,12 +163,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApplePayInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApplePayInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApplePayInfo` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("domains") != null && !jsonObj.get("domains").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `domains` to be an array in the JSON string but got `%s`", jsonObj.get("domains").toString())); + log.log(Level.WARNING, String.format("Expected the field `domains` to be an array in the JSON string but got `%s`", jsonObj.get("domains").toString())); } } diff --git a/src/main/java/com/adyen/model/management/BcmcInfo.java b/src/main/java/com/adyen/model/management/BcmcInfo.java index 2aaa96187..a127e9984 100644 --- a/src/main/java/com/adyen/model/management/BcmcInfo.java +++ b/src/main/java/com/adyen/model/management/BcmcInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BcmcInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,7 +153,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BcmcInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BcmcInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BcmcInfo` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java b/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java index 3315956cd..32bde2086 100644 --- a/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java +++ b/src/main/java/com/adyen/model/management/BillingEntitiesResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BillingEntitiesResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BillingEntitiesResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BillingEntitiesResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BillingEntitiesResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/BillingEntity.java b/src/main/java/com/adyen/model/management/BillingEntity.java index d41f4eef5..2aa6d0d9e 100644 --- a/src/main/java/com/adyen/model/management/BillingEntity.java +++ b/src/main/java/com/adyen/model/management/BillingEntity.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BillingEntity.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,7 +270,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BillingEntity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BillingEntity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BillingEntity` properties.", entry.getKey())); } } // validate the optional field `address` @@ -273,19 +279,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CardholderReceipt.java b/src/main/java/com/adyen/model/management/CardholderReceipt.java index 14c2b1ef1..1229d456d 100644 --- a/src/main/java/com/adyen/model/management/CardholderReceipt.java +++ b/src/main/java/com/adyen/model/management/CardholderReceipt.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardholderReceipt.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CardholderReceipt.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CardholderReceipt` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardholderReceipt` properties.", entry.getKey())); } } // validate the optional field headerForAuthorizedReceipt if (jsonObj.get("headerForAuthorizedReceipt") != null && !jsonObj.get("headerForAuthorizedReceipt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `headerForAuthorizedReceipt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("headerForAuthorizedReceipt").toString())); + log.log(Level.WARNING, String.format("Expected the field `headerForAuthorizedReceipt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("headerForAuthorizedReceipt").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CartesBancairesInfo.java b/src/main/java/com/adyen/model/management/CartesBancairesInfo.java index 1710698f6..f1b8e8015 100644 --- a/src/main/java/com/adyen/model/management/CartesBancairesInfo.java +++ b/src/main/java/com/adyen/model/management/CartesBancairesInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("siret"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CartesBancairesInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CartesBancairesInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CartesBancairesInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CartesBancairesInfo` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field siret if (jsonObj.get("siret") != null && !jsonObj.get("siret").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `siret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("siret").toString())); + log.log(Level.WARNING, String.format("Expected the field `siret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("siret").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ClearpayInfo.java b/src/main/java/com/adyen/model/management/ClearpayInfo.java new file mode 100644 index 000000000..2374d0c81 --- /dev/null +++ b/src/main/java/com/adyen/model/management/ClearpayInfo.java @@ -0,0 +1,222 @@ +/* + * 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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.management.JSON; + +/** + * ClearpayInfo + */ + +public class ClearpayInfo { + public static final String SERIALIZED_NAME_SUPPORT_URL = "supportUrl"; + @SerializedName(SERIALIZED_NAME_SUPPORT_URL) + private String supportUrl; + + public ClearpayInfo() { + } + + public ClearpayInfo supportUrl(String supportUrl) { + + this.supportUrl = supportUrl; + return this; + } + + /** + * Support Url + * @return supportUrl + **/ + @ApiModelProperty(required = true, value = "Support Url") + + public String getSupportUrl() { + return supportUrl; + } + + + public void setSupportUrl(String supportUrl) { + this.supportUrl = supportUrl; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClearpayInfo clearpayInfo = (ClearpayInfo) o; + return Objects.equals(this.supportUrl, clearpayInfo.supportUrl); + } + + @Override + public int hashCode() { + return Objects.hash(supportUrl); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClearpayInfo {\n"); + sb.append(" supportUrl: ").append(toIndentedString(supportUrl)).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("supportUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("supportUrl"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ClearpayInfo.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClearpayInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ClearpayInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ClearpayInfo is not found in the empty JSON string", ClearpayInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClearpayInfo.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ClearpayInfo` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ClearpayInfo.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 supportUrl + if (jsonObj.get("supportUrl") != null && !jsonObj.get("supportUrl").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `supportUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ClearpayInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClearpayInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClearpayInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ClearpayInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ClearpayInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClearpayInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClearpayInfo + * @throws IOException if the JSON string is invalid with respect to ClearpayInfo + */ + public static ClearpayInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClearpayInfo.class); + } + + /** + * Convert an instance of ClearpayInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/management/Company.java b/src/main/java/com/adyen/model/management/Company.java index 77755a863..ee1f33682 100644 --- a/src/main/java/com/adyen/model/management/Company.java +++ b/src/main/java/com/adyen/model/management/Company.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -313,6 +315,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Company.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -333,7 +339,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Company.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Company` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Company` properties.", entry.getKey())); } } // validate the optional field `_links` @@ -354,23 +360,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CompanyApiCredential.java b/src/main/java/com/adyen/model/management/CompanyApiCredential.java index 9a6b1008a..e50ed6c45 100644 --- a/src/main/java/com/adyen/model/management/CompanyApiCredential.java +++ b/src/main/java/com/adyen/model/management/CompanyApiCredential.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -424,6 +426,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("roles"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CompanyApiCredential.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -444,7 +450,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CompanyApiCredential.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompanyApiCredential` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CompanyApiCredential` properties.", entry.getKey())); } } @@ -460,7 +466,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("allowedIpAddresses") != null && !jsonObj.get("allowedIpAddresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); } JsonArray jsonArrayallowedOrigins = jsonObj.getAsJsonArray("allowedOrigins"); if (jsonArrayallowedOrigins != null) { @@ -476,27 +482,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CompanyLinks.java b/src/main/java/com/adyen/model/management/CompanyLinks.java index 092b961bd..2c30a45d2 100644 --- a/src/main/java/com/adyen/model/management/CompanyLinks.java +++ b/src/main/java/com/adyen/model/management/CompanyLinks.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -216,6 +218,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("self"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CompanyLinks.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -236,7 +242,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CompanyLinks.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompanyLinks` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CompanyLinks` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/CompanyUser.java b/src/main/java/com/adyen/model/management/CompanyUser.java index d8333789f..b9288a900 100644 --- a/src/main/java/com/adyen/model/management/CompanyUser.java +++ b/src/main/java/com/adyen/model/management/CompanyUser.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -64,14 +66,14 @@ public class CompanyUser { @SerializedName(SERIALIZED_NAME_ACTIVE) private Boolean active; + public static final String SERIALIZED_NAME_APPS = "apps"; + @SerializedName(SERIALIZED_NAME_APPS) + private List apps = null; + public static final String SERIALIZED_NAME_ASSOCIATED_MERCHANT_ACCOUNTS = "associatedMerchantAccounts"; @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; @@ -173,63 +175,63 @@ public void setActive(Boolean active) { } - public CompanyUser associatedMerchantAccounts(List associatedMerchantAccounts) { + public CompanyUser apps(List apps) { - this.associatedMerchantAccounts = associatedMerchantAccounts; + this.apps = apps; return this; } - public CompanyUser addAssociatedMerchantAccountsItem(String associatedMerchantAccountsItem) { - if (this.associatedMerchantAccounts == null) { - this.associatedMerchantAccounts = new ArrayList<>(); + public CompanyUser addAppsItem(String appsItem) { + if (this.apps == null) { + this.apps = new ArrayList<>(); } - this.associatedMerchantAccounts.add(associatedMerchantAccountsItem); + this.apps.add(appsItem); return this; } /** - * The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. - * @return associatedMerchantAccounts + * Set of apps available to this user + * @return apps **/ - @ApiModelProperty(value = "The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user.") + @ApiModelProperty(value = "Set of apps available to this user") - public List getAssociatedMerchantAccounts() { - return associatedMerchantAccounts; + public List getApps() { + return apps; } - public void setAssociatedMerchantAccounts(List associatedMerchantAccounts) { - this.associatedMerchantAccounts = associatedMerchantAccounts; + public void setApps(List apps) { + this.apps = apps; } - public CompanyUser authnApps(List authnApps) { + public CompanyUser associatedMerchantAccounts(List associatedMerchantAccounts) { - this.authnApps = authnApps; + this.associatedMerchantAccounts = associatedMerchantAccounts; return this; } - public CompanyUser addAuthnAppsItem(String authnAppsItem) { - if (this.authnApps == null) { - this.authnApps = new ArrayList<>(); + public CompanyUser addAssociatedMerchantAccountsItem(String associatedMerchantAccountsItem) { + if (this.associatedMerchantAccounts == null) { + this.associatedMerchantAccounts = new ArrayList<>(); } - this.authnApps.add(authnAppsItem); + this.associatedMerchantAccounts.add(associatedMerchantAccountsItem); return this; } /** - * Set of authn apps available to this user - * @return authnApps + * The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * @return associatedMerchantAccounts **/ - @ApiModelProperty(value = "Set of authn apps available to this user") + @ApiModelProperty(value = "The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user.") - public List getAuthnApps() { - return authnApps; + public List getAssociatedMerchantAccounts() { + return associatedMerchantAccounts; } - public void setAuthnApps(List authnApps) { - this.authnApps = authnApps; + public void setAssociatedMerchantAccounts(List associatedMerchantAccounts) { + this.associatedMerchantAccounts = associatedMerchantAccounts; } @@ -383,8 +385,8 @@ public boolean equals(Object o) { return Objects.equals(this.links, companyUser.links) && Objects.equals(this.accountGroups, companyUser.accountGroups) && Objects.equals(this.active, companyUser.active) && + Objects.equals(this.apps, companyUser.apps) && 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) && @@ -395,7 +397,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, associatedMerchantAccounts, authnApps, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, apps, associatedMerchantAccounts, email, id, name, roles, timeZoneCode, username); } @Override @@ -405,8 +407,8 @@ 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(" apps: ").append(toIndentedString(apps)).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"); @@ -438,8 +440,8 @@ private String toIndentedString(Object o) { openapiFields.add("_links"); openapiFields.add("accountGroups"); openapiFields.add("active"); + openapiFields.add("apps"); openapiFields.add("associatedMerchantAccounts"); - openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -455,6 +457,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timeZoneCode"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CompanyUser.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -475,7 +481,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CompanyUser.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CompanyUser` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CompanyUser` properties.", entry.getKey())); } } @@ -491,23 +497,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, 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("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())); + if (jsonObj.get("apps") != null && !jsonObj.get("apps").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `apps` to be an array in the JSON string but got `%s`", jsonObj.get("apps").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())); + if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -515,15 +521,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Connectivity.java b/src/main/java/com/adyen/model/management/Connectivity.java index 5c7255058..aae13e09b 100644 --- a/src/main/java/com/adyen/model/management/Connectivity.java +++ b/src/main/java/com/adyen/model/management/Connectivity.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -174,6 +176,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Connectivity.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -194,7 +200,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Connectivity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Connectivity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Connectivity` properties.", entry.getKey())); } } // ensure the field simcardStatus can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/management/Contact.java b/src/main/java/com/adyen/model/management/Contact.java index 056a8a79f..44c39afe6 100644 --- a/src/main/java/com/adyen/model/management/Contact.java +++ b/src/main/java/com/adyen/model/management/Contact.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -243,6 +245,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Contact.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -263,28 +269,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Contact.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Contact` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Contact` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // 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())); + log.log(Level.WARNING, 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 infix if (jsonObj.get("infix") != null && !jsonObj.get("infix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `infix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("infix").toString())); + log.log(Level.WARNING, String.format("Expected the field `infix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("infix").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())); + log.log(Level.WARNING, 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 phoneNumber if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateAllowedOriginRequest.java b/src/main/java/com/adyen/model/management/CreateAllowedOriginRequest.java index 35b721fe7..c74d95c05 100644 --- a/src/main/java/com/adyen/model/management/CreateAllowedOriginRequest.java +++ b/src/main/java/com/adyen/model/management/CreateAllowedOriginRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("domain"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateAllowedOriginRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateAllowedOriginRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateAllowedOriginRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateAllowedOriginRequest` properties.", entry.getKey())); } } @@ -223,11 +229,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field domain if (jsonObj.get("domain") != null && !jsonObj.get("domain").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString())); + log.log(Level.WARNING, String.format("Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java b/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java index a9ab0ef2b..0d5d302ac 100644 --- a/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java +++ b/src/main/java/com/adyen/model/management/CreateApiCredentialResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -447,6 +449,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("roles"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateApiCredentialResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -467,7 +473,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateApiCredentialResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateApiCredentialResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateApiCredentialResponse` properties.", entry.getKey())); } } @@ -483,7 +489,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("allowedIpAddresses") != null && !jsonObj.get("allowedIpAddresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); } JsonArray jsonArrayallowedOrigins = jsonObj.getAsJsonArray("allowedOrigins"); if (jsonArrayallowedOrigins != null) { @@ -499,31 +505,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field apiKey if (jsonObj.get("apiKey") != null && !jsonObj.get("apiKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString())); } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialRequest.java b/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialRequest.java index 422fdc64a..f12522261 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialRequest.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -240,6 +242,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCompanyApiCredentialRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -260,24 +266,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCompanyApiCredentialRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyApiCredentialRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyApiCredentialRequest` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("allowedOrigins") != null && !jsonObj.get("allowedOrigins").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").toString())); } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").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())); + log.log(Level.WARNING, 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("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java b/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java index 0b65821c6..95b5ae919 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyApiCredentialResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -482,6 +484,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("roles"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCompanyApiCredentialResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -502,7 +508,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCompanyApiCredentialResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyApiCredentialResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyApiCredentialResponse` properties.", entry.getKey())); } } @@ -518,7 +524,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("allowedIpAddresses") != null && !jsonObj.get("allowedIpAddresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); } JsonArray jsonArrayallowedOrigins = jsonObj.getAsJsonArray("allowedOrigins"); if (jsonArrayallowedOrigins != null) { @@ -534,35 +540,35 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field apiKey if (jsonObj.get("apiKey") != null && !jsonObj.get("apiKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString())); } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java b/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java index 14ced6043..9f7fa1a19 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyUserRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -59,10 +61,6 @@ 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; @@ -146,36 +144,6 @@ 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; @@ -279,10 +247,10 @@ public CreateCompanyUserRequest username(String username) { } /** - * The username for this user. Allowed length: 255 alphanumeric characters. + * The user's email address that will be their username. Must be the same as the one in the `email` field. * @return username **/ - @ApiModelProperty(required = true, value = "The username for this user. Allowed length: 255 alphanumeric characters.") + @ApiModelProperty(required = true, value = "The user's email address that will be their username. Must be the same as the one in the `email` field.") public String getUsername() { return username; @@ -306,7 +274,6 @@ 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) && @@ -316,7 +283,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, associatedMerchantAccounts, authnApps, email, name, roles, timeZoneCode, username); + return Objects.hash(accountGroups, associatedMerchantAccounts, email, name, roles, timeZoneCode, username); } @Override @@ -325,7 +292,6 @@ 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"); @@ -355,7 +321,6 @@ 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"); @@ -368,6 +333,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCompanyUserRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -388,7 +357,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCompanyUserRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyUserRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyUserRequest` properties.", entry.getKey())); } } @@ -400,19 +369,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, 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("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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -420,15 +385,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java b/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java index 671548bff..ed563c099 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyUserResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -64,14 +66,14 @@ public class CreateCompanyUserResponse { @SerializedName(SERIALIZED_NAME_ACTIVE) private Boolean active; + public static final String SERIALIZED_NAME_APPS = "apps"; + @SerializedName(SERIALIZED_NAME_APPS) + private List apps = null; + public static final String SERIALIZED_NAME_ASSOCIATED_MERCHANT_ACCOUNTS = "associatedMerchantAccounts"; @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; @@ -173,63 +175,63 @@ public void setActive(Boolean active) { } - public CreateCompanyUserResponse associatedMerchantAccounts(List associatedMerchantAccounts) { + public CreateCompanyUserResponse apps(List apps) { - this.associatedMerchantAccounts = associatedMerchantAccounts; + this.apps = apps; return this; } - public CreateCompanyUserResponse addAssociatedMerchantAccountsItem(String associatedMerchantAccountsItem) { - if (this.associatedMerchantAccounts == null) { - this.associatedMerchantAccounts = new ArrayList<>(); + public CreateCompanyUserResponse addAppsItem(String appsItem) { + if (this.apps == null) { + this.apps = new ArrayList<>(); } - this.associatedMerchantAccounts.add(associatedMerchantAccountsItem); + this.apps.add(appsItem); return this; } /** - * The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. - * @return associatedMerchantAccounts + * Set of apps available to this user + * @return apps **/ - @ApiModelProperty(value = "The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user.") + @ApiModelProperty(value = "Set of apps available to this user") - public List getAssociatedMerchantAccounts() { - return associatedMerchantAccounts; + public List getApps() { + return apps; } - public void setAssociatedMerchantAccounts(List associatedMerchantAccounts) { - this.associatedMerchantAccounts = associatedMerchantAccounts; + public void setApps(List apps) { + this.apps = apps; } - public CreateCompanyUserResponse authnApps(List authnApps) { + public CreateCompanyUserResponse associatedMerchantAccounts(List associatedMerchantAccounts) { - this.authnApps = authnApps; + this.associatedMerchantAccounts = associatedMerchantAccounts; return this; } - public CreateCompanyUserResponse addAuthnAppsItem(String authnAppsItem) { - if (this.authnApps == null) { - this.authnApps = new ArrayList<>(); + public CreateCompanyUserResponse addAssociatedMerchantAccountsItem(String associatedMerchantAccountsItem) { + if (this.associatedMerchantAccounts == null) { + this.associatedMerchantAccounts = new ArrayList<>(); } - this.authnApps.add(authnAppsItem); + this.associatedMerchantAccounts.add(associatedMerchantAccountsItem); return this; } /** - * Set of authn apps available to this user - * @return authnApps + * The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user. + * @return associatedMerchantAccounts **/ - @ApiModelProperty(value = "Set of authn apps available to this user") + @ApiModelProperty(value = "The list of [merchant accounts](https://docs.adyen.com/account/account-structure#merchant-accounts) associated with this user.") - public List getAuthnApps() { - return authnApps; + public List getAssociatedMerchantAccounts() { + return associatedMerchantAccounts; } - public void setAuthnApps(List authnApps) { - this.authnApps = authnApps; + public void setAssociatedMerchantAccounts(List associatedMerchantAccounts) { + this.associatedMerchantAccounts = associatedMerchantAccounts; } @@ -383,8 +385,8 @@ public boolean equals(Object o) { return Objects.equals(this.links, createCompanyUserResponse.links) && Objects.equals(this.accountGroups, createCompanyUserResponse.accountGroups) && Objects.equals(this.active, createCompanyUserResponse.active) && + Objects.equals(this.apps, createCompanyUserResponse.apps) && 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) && @@ -395,7 +397,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, associatedMerchantAccounts, authnApps, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, apps, associatedMerchantAccounts, email, id, name, roles, timeZoneCode, username); } @Override @@ -405,8 +407,8 @@ 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(" apps: ").append(toIndentedString(apps)).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"); @@ -438,8 +440,8 @@ private String toIndentedString(Object o) { openapiFields.add("_links"); openapiFields.add("accountGroups"); openapiFields.add("active"); + openapiFields.add("apps"); openapiFields.add("associatedMerchantAccounts"); - openapiFields.add("authnApps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -455,6 +457,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timeZoneCode"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCompanyUserResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -475,7 +481,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCompanyUserResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyUserResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyUserResponse` properties.", entry.getKey())); } } @@ -491,23 +497,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, 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("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())); + if (jsonObj.get("apps") != null && !jsonObj.get("apps").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `apps` to be an array in the JSON string but got `%s`", jsonObj.get("apps").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())); + if (jsonObj.get("associatedMerchantAccounts") != null && !jsonObj.get("associatedMerchantAccounts").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -515,15 +521,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java b/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java index 7681839a1..107f82da2 100644 --- a/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/CreateCompanyWebhookRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -780,6 +782,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("type"); openapiRequiredFields.add("url"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateCompanyWebhookRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -800,7 +806,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateCompanyWebhookRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyWebhookRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateCompanyWebhookRequest` properties.", entry.getKey())); } } @@ -823,7 +829,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // ensure the field filterMerchantAccountType can be parsed to an enum value if (jsonObj.get("filterMerchantAccountType") != null) { @@ -834,7 +840,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("filterMerchantAccounts") != null && !jsonObj.get("filterMerchantAccounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `filterMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("filterMerchantAccounts").toString())); + log.log(Level.WARNING, String.format("Expected the field `filterMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("filterMerchantAccounts").toString())); } // ensure the field networkType can be parsed to an enum value if (jsonObj.get("networkType") != null) { @@ -845,7 +851,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // ensure the field sslVersion can be parsed to an enum value if (jsonObj.get("sslVersion") != null) { @@ -856,15 +862,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateMerchantApiCredentialRequest.java b/src/main/java/com/adyen/model/management/CreateMerchantApiCredentialRequest.java index 02264613c..3154c5a54 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantApiCredentialRequest.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantApiCredentialRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateMerchantApiCredentialRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,20 +229,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateMerchantApiCredentialRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantApiCredentialRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantApiCredentialRequest` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("allowedOrigins") != null && !jsonObj.get("allowedOrigins").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").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())); + log.log(Level.WARNING, 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("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateMerchantRequest.java b/src/main/java/com/adyen/model/management/CreateMerchantRequest.java index 92bc32641..38f94c706 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantRequest.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -312,6 +314,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("companyId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateMerchantRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -332,7 +338,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateMerchantRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantRequest` properties.", entry.getKey())); } } @@ -344,31 +350,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field businessLineId if (jsonObj.get("businessLineId") != null && !jsonObj.get("businessLineId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); } // validate the optional field companyId if (jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + log.log(Level.WARNING, String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").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())); + log.log(Level.WARNING, 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 legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } // validate the optional field pricingPlan if (jsonObj.get("pricingPlan") != null && !jsonObj.get("pricingPlan").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pricingPlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricingPlan").toString())); + log.log(Level.WARNING, String.format("Expected the field `pricingPlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricingPlan").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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `salesChannels` to be an array in the JSON string but got `%s`", jsonObj.get("salesChannels").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateMerchantResponse.java b/src/main/java/com/adyen/model/management/CreateMerchantResponse.java index 05eb9229a..909840a26 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantResponse.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -301,6 +303,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateMerchantResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -321,36 +327,36 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateMerchantResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantResponse` properties.", entry.getKey())); } } // validate the optional field businessLineId if (jsonObj.get("businessLineId") != null && !jsonObj.get("businessLineId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); } // validate the optional field companyId if (jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + log.log(Level.WARNING, String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field legalEntityId 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())); + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); } // validate the optional field pricingPlan if (jsonObj.get("pricingPlan") != null && !jsonObj.get("pricingPlan").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pricingPlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricingPlan").toString())); + log.log(Level.WARNING, String.format("Expected the field `pricingPlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricingPlan").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())); + log.log(Level.WARNING, 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/management/CreateMerchantUserRequest.java b/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java index c2c68dce2..3bd9279d3 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantUserRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -55,10 +57,6 @@ 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; @@ -112,36 +110,6 @@ 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; @@ -245,10 +213,10 @@ public CreateMerchantUserRequest username(String username) { } /** - * The username for this user. Allowed length: 255 alphanumeric characters. + * The user's email address that will be their username. Must be the same as the one in the `email` field. * @return username **/ - @ApiModelProperty(required = true, value = "The username for this user. Allowed length: 255 alphanumeric characters.") + @ApiModelProperty(required = true, value = "The user's email address that will be their username. Must be the same as the one in the `email` field.") public String getUsername() { return username; @@ -271,7 +239,6 @@ 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) && @@ -281,7 +248,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, authnApps, email, name, roles, timeZoneCode, username); + return Objects.hash(accountGroups, email, name, roles, timeZoneCode, username); } @Override @@ -289,7 +256,6 @@ 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"); @@ -318,7 +284,6 @@ 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"); @@ -331,6 +296,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateMerchantUserRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -351,7 +320,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateMerchantUserRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantUserRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantUserRequest` properties.", entry.getKey())); } } @@ -363,15 +332,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `accountGroups` to be an array in the JSON string but got `%s`", jsonObj.get("accountGroups").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -379,15 +344,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java b/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java index 3be78957e..d14924b38 100644 --- a/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/CreateMerchantWebhookRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -664,6 +666,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("type"); openapiRequiredFields.add("url"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateMerchantWebhookRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -684,7 +690,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateMerchantWebhookRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantWebhookRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateMerchantWebhookRequest` properties.", entry.getKey())); } } @@ -707,7 +713,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // ensure the field networkType can be parsed to an enum value if (jsonObj.get("networkType") != null) { @@ -718,7 +724,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // ensure the field sslVersion can be parsed to an enum value if (jsonObj.get("sslVersion") != null) { @@ -729,15 +735,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CreateUserResponse.java b/src/main/java/com/adyen/model/management/CreateUserResponse.java index c2a5d476c..73b41b98e 100644 --- a/src/main/java/com/adyen/model/management/CreateUserResponse.java +++ b/src/main/java/com/adyen/model/management/CreateUserResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -64,9 +66,9 @@ 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_APPS = "apps"; + @SerializedName(SERIALIZED_NAME_APPS) + private List apps = null; public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -169,33 +171,33 @@ public void setActive(Boolean active) { } - public CreateUserResponse authnApps(List authnApps) { + public CreateUserResponse apps(List apps) { - this.authnApps = authnApps; + this.apps = apps; return this; } - public CreateUserResponse addAuthnAppsItem(String authnAppsItem) { - if (this.authnApps == null) { - this.authnApps = new ArrayList<>(); + public CreateUserResponse addAppsItem(String appsItem) { + if (this.apps == null) { + this.apps = new ArrayList<>(); } - this.authnApps.add(authnAppsItem); + this.apps.add(appsItem); return this; } /** - * Set of authn apps available to this user - * @return authnApps + * Set of apps available to this user + * @return apps **/ - @ApiModelProperty(value = "Set of authn apps available to this user") + @ApiModelProperty(value = "Set of apps available to this user") - public List getAuthnApps() { - return authnApps; + public List getApps() { + return apps; } - public void setAuthnApps(List authnApps) { - this.authnApps = authnApps; + public void setApps(List apps) { + this.apps = apps; } @@ -349,7 +351,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.apps, createUserResponse.apps) && Objects.equals(this.email, createUserResponse.email) && Objects.equals(this.id, createUserResponse.id) && Objects.equals(this.name, createUserResponse.name) && @@ -360,7 +362,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, authnApps, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, apps, email, id, name, roles, timeZoneCode, username); } @Override @@ -370,7 +372,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(" apps: ").append(toIndentedString(apps)).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"); @@ -402,7 +404,7 @@ private String toIndentedString(Object o) { openapiFields.add("_links"); openapiFields.add("accountGroups"); openapiFields.add("active"); - openapiFields.add("authnApps"); + openapiFields.add("apps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -418,6 +420,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timeZoneCode"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreateUserResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -438,7 +444,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreateUserResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreateUserResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreateUserResponse` properties.", entry.getKey())); } } @@ -454,19 +460,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, 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())); + if (jsonObj.get("apps") != null && !jsonObj.get("apps").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `apps` to be an array in the JSON string but got `%s`", jsonObj.get("apps").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -474,15 +480,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Currency.java b/src/main/java/com/adyen/model/management/Currency.java index ff87c2004..70c5293f3 100644 --- a/src/main/java/com/adyen/model/management/Currency.java +++ b/src/main/java/com/adyen/model/management/Currency.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("currencyCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Currency.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,7 +212,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Currency.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Currency` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Currency` properties.", entry.getKey())); } } @@ -218,7 +224,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currencyCode").toString())); } } diff --git a/src/main/java/com/adyen/model/management/CustomNotification.java b/src/main/java/com/adyen/model/management/CustomNotification.java index bf3a341c5..eccd3dd98 100644 --- a/src/main/java/com/adyen/model/management/CustomNotification.java +++ b/src/main/java/com/adyen/model/management/CustomNotification.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -303,6 +305,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CustomNotification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -323,7 +329,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CustomNotification.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CustomNotification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CustomNotification` properties.", entry.getKey())); } } // validate the optional field `amount` @@ -332,19 +338,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field eventCode if (jsonObj.get("eventCode") != null && !jsonObj.get("eventCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eventCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `eventCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eventCode").toString())); } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field paymentMethod if (jsonObj.get("paymentMethod") != null && !jsonObj.get("paymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); } // validate the optional field reason if (jsonObj.get("reason") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); } } diff --git a/src/main/java/com/adyen/model/management/DataCenter.java b/src/main/java/com/adyen/model/management/DataCenter.java index 83085629c..2263e7f5f 100644 --- a/src/main/java/com/adyen/model/management/DataCenter.java +++ b/src/main/java/com/adyen/model/management/DataCenter.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DataCenter.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DataCenter.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DataCenter` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DataCenter` properties.", entry.getKey())); } } // validate the optional field livePrefix if (jsonObj.get("livePrefix") != null && !jsonObj.get("livePrefix").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `livePrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("livePrefix").toString())); + log.log(Level.WARNING, String.format("Expected the field `livePrefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("livePrefix").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/management/EventUrl.java b/src/main/java/com/adyen/model/management/EventUrl.java index dff0cc97f..611fcc77d 100644 --- a/src/main/java/com/adyen/model/management/EventUrl.java +++ b/src/main/java/com/adyen/model/management/EventUrl.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -175,6 +177,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(EventUrl.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -195,7 +201,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!EventUrl.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EventUrl` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `EventUrl` properties.", entry.getKey())); } } JsonArray jsonArrayeventLocalUrls = jsonObj.getAsJsonArray("eventLocalUrls"); diff --git a/src/main/java/com/adyen/model/management/ExternalTerminalAction.java b/src/main/java/com/adyen/model/management/ExternalTerminalAction.java index d5fa30204..0e97559bc 100644 --- a/src/main/java/com/adyen/model/management/ExternalTerminalAction.java +++ b/src/main/java/com/adyen/model/management/ExternalTerminalAction.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -331,6 +333,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ExternalTerminalAction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -351,32 +357,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ExternalTerminalAction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExternalTerminalAction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ExternalTerminalAction` properties.", entry.getKey())); } } // validate the optional field actionType if (jsonObj.get("actionType") != null && !jsonObj.get("actionType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `actionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionType").toString())); + log.log(Level.WARNING, String.format("Expected the field `actionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("actionType").toString())); } // validate the optional field config if (jsonObj.get("config") != null && !jsonObj.get("config").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `config` to be a primitive type in the JSON string but got `%s`", jsonObj.get("config").toString())); + log.log(Level.WARNING, String.format("Expected the field `config` to be a primitive type in the JSON string but got `%s`", jsonObj.get("config").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field result if (jsonObj.get("result") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").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())); + log.log(Level.WARNING, 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 terminalId if (jsonObj.get("terminalId") != null && !jsonObj.get("terminalId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/management/GenerateApiKeyResponse.java b/src/main/java/com/adyen/model/management/GenerateApiKeyResponse.java index 49b7ac3b6..ca143be36 100644 --- a/src/main/java/com/adyen/model/management/GenerateApiKeyResponse.java +++ b/src/main/java/com/adyen/model/management/GenerateApiKeyResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("apiKey"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GenerateApiKeyResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GenerateApiKeyResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateApiKeyResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GenerateApiKeyResponse` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field apiKey if (jsonObj.get("apiKey") != null && !jsonObj.get("apiKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString())); } } diff --git a/src/main/java/com/adyen/model/management/GenerateClientKeyResponse.java b/src/main/java/com/adyen/model/management/GenerateClientKeyResponse.java index a2539a328..c39a4ea3e 100644 --- a/src/main/java/com/adyen/model/management/GenerateClientKeyResponse.java +++ b/src/main/java/com/adyen/model/management/GenerateClientKeyResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("clientKey"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GenerateClientKeyResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GenerateClientKeyResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateClientKeyResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GenerateClientKeyResponse` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); } } diff --git a/src/main/java/com/adyen/model/management/GenerateHmacKeyResponse.java b/src/main/java/com/adyen/model/management/GenerateHmacKeyResponse.java index c5cce4ae9..c2cb1d8db 100644 --- a/src/main/java/com/adyen/model/management/GenerateHmacKeyResponse.java +++ b/src/main/java/com/adyen/model/management/GenerateHmacKeyResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("hmacKey"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GenerateHmacKeyResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GenerateHmacKeyResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GenerateHmacKeyResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GenerateHmacKeyResponse` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field hmacKey if (jsonObj.get("hmacKey") != null && !jsonObj.get("hmacKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hmacKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hmacKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `hmacKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hmacKey").toString())); } } diff --git a/src/main/java/com/adyen/model/management/GiroPayInfo.java b/src/main/java/com/adyen/model/management/GiroPayInfo.java index 70610a5ee..cd65aaef9 100644 --- a/src/main/java/com/adyen/model/management/GiroPayInfo.java +++ b/src/main/java/com/adyen/model/management/GiroPayInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("supportEmail"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GiroPayInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GiroPayInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `GiroPayInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GiroPayInfo` properties.", entry.getKey())); } } @@ -160,7 +166,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field supportEmail if (jsonObj.get("supportEmail") != null && !jsonObj.get("supportEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); } } diff --git a/src/main/java/com/adyen/model/management/GooglePayInfo.java b/src/main/java/com/adyen/model/management/GooglePayInfo.java index 8b583d8b7..c1f3ce91c 100644 --- a/src/main/java/com/adyen/model/management/GooglePayInfo.java +++ b/src/main/java/com/adyen/model/management/GooglePayInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GooglePayInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!GooglePayInfo.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GooglePayInfo` properties.", entry.getKey())); } } @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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/Gratuity.java b/src/main/java/com/adyen/model/management/Gratuity.java index 136ffbc5d..7bd8cbf13 100644 --- a/src/main/java/com/adyen/model/management/Gratuity.java +++ b/src/main/java/com/adyen/model/management/Gratuity.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -224,6 +226,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Gratuity.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -244,16 +250,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Gratuity.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Gratuity` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Gratuity` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } // ensure the json data is an array if (jsonObj.get("predefinedTipEntries") != null && !jsonObj.get("predefinedTipEntries").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `predefinedTipEntries` to be an array in the JSON string but got `%s`", jsonObj.get("predefinedTipEntries").toString())); + log.log(Level.WARNING, String.format("Expected the field `predefinedTipEntries` to be an array in the JSON string but got `%s`", jsonObj.get("predefinedTipEntries").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Hardware.java b/src/main/java/com/adyen/model/management/Hardware.java index 0dc792cc3..7d3ccb603 100644 --- a/src/main/java/com/adyen/model/management/Hardware.java +++ b/src/main/java/com/adyen/model/management/Hardware.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Hardware.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,7 +153,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Hardware.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Hardware` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Hardware` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/management/IdName.java b/src/main/java/com/adyen/model/management/IdName.java index 1dc84c7cf..48dd104f0 100644 --- a/src/main/java/com/adyen/model/management/IdName.java +++ b/src/main/java/com/adyen/model/management/IdName.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IdName.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!IdName.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IdName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IdName` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/management/InstallAndroidAppDetails.java b/src/main/java/com/adyen/model/management/InstallAndroidAppDetails.java index ce07948e7..35cfab079 100644 --- a/src/main/java/com/adyen/model/management/InstallAndroidAppDetails.java +++ b/src/main/java/com/adyen/model/management/InstallAndroidAppDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InstallAndroidAppDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,12 +227,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!InstallAndroidAppDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InstallAndroidAppDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InstallAndroidAppDetails` properties.", entry.getKey())); } } // validate the optional field appId if (jsonObj.get("appId") != null && !jsonObj.get("appId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); + log.log(Level.WARNING, String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); } // 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/management/InstallAndroidCertificateDetails.java b/src/main/java/com/adyen/model/management/InstallAndroidCertificateDetails.java index 58e324c23..e74d8aa2e 100644 --- a/src/main/java/com/adyen/model/management/InstallAndroidCertificateDetails.java +++ b/src/main/java/com/adyen/model/management/InstallAndroidCertificateDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InstallAndroidCertificateDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,12 +227,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!InstallAndroidCertificateDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InstallAndroidCertificateDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InstallAndroidCertificateDetails` properties.", entry.getKey())); } } // validate the optional field certificateId if (jsonObj.get("certificateId") != null && !jsonObj.get("certificateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certificateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certificateId").toString())); + log.log(Level.WARNING, String.format("Expected the field `certificateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certificateId").toString())); } // 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/management/InvalidField.java b/src/main/java/com/adyen/model/management/InvalidField.java index 1f1091463..c8be17461 100644 --- a/src/main/java/com/adyen/model/management/InvalidField.java +++ b/src/main/java/com/adyen/model/management/InvalidField.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InvalidField.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InvalidField` properties.", entry.getKey())); } } @@ -220,15 +226,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field name if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field value if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/management/InvalidFieldWrapper.java b/src/main/java/com/adyen/model/management/InvalidFieldWrapper.java new file mode 100644 index 000000000..0aedb62d9 --- /dev/null +++ b/src/main/java/com/adyen/model/management/InvalidFieldWrapper.java @@ -0,0 +1,215 @@ +/* + * 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.adyen.model.management.InvalidField; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.management.JSON; + +/** + * InvalidFieldWrapper + */ + +public class InvalidFieldWrapper { + public static final String SERIALIZED_NAME_INVALID_FIELD = "InvalidField"; + @SerializedName(SERIALIZED_NAME_INVALID_FIELD) + private InvalidField invalidField; + + public InvalidFieldWrapper() { + } + + public InvalidFieldWrapper invalidField(InvalidField invalidField) { + + this.invalidField = invalidField; + return this; + } + + /** + * Get invalidField + * @return invalidField + **/ + @ApiModelProperty(value = "") + + public InvalidField getInvalidField() { + return invalidField; + } + + + public void setInvalidField(InvalidField invalidField) { + this.invalidField = invalidField; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvalidFieldWrapper invalidFieldWrapper = (InvalidFieldWrapper) o; + return Objects.equals(this.invalidField, invalidFieldWrapper.invalidField); + } + + @Override + public int hashCode() { + return Objects.hash(invalidField); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvalidFieldWrapper {\n"); + sb.append(" invalidField: ").append(toIndentedString(invalidField)).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("InvalidField"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InvalidFieldWrapper.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InvalidFieldWrapper + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (InvalidFieldWrapper.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in InvalidFieldWrapper is not found in the empty JSON string", InvalidFieldWrapper.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InvalidFieldWrapper.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InvalidFieldWrapper` properties.", entry.getKey())); + } + } + // validate the optional field `InvalidField` + if (jsonObj.getAsJsonObject("InvalidField") != null) { + InvalidField.validateJsonObject(jsonObj.getAsJsonObject("InvalidField")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!InvalidFieldWrapper.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvalidFieldWrapper' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvalidFieldWrapper.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, InvalidFieldWrapper value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public InvalidFieldWrapper read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvalidFieldWrapper given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvalidFieldWrapper + * @throws IOException if the JSON string is invalid with respect to InvalidFieldWrapper + */ + public static InvalidFieldWrapper fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvalidFieldWrapper.class); + } + + /** + * Convert an instance of InvalidFieldWrapper to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/management/JSON.java b/src/main/java/com/adyen/model/management/JSON.java index 1867abe98..3d3dfe166 100644 --- a/src/main/java/com/adyen/model/management/JSON.java +++ b/src/main/java/com/adyen/model/management/JSON.java @@ -95,6 +95,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.AdditionalSettings.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.AdditionalSettingsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Address.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.AfterpayTouchInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.AllowedOrigin.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.AllowedOriginsResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Amount.CustomTypeAdapterFactory()); @@ -110,6 +111,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.BillingEntity.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.CardholderReceipt.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.CartesBancairesInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.ClearpayInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Company.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.CompanyApiCredential.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.CompanyLinks.CustomTypeAdapterFactory()); @@ -145,8 +147,10 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.InstallAndroidAppDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.InstallAndroidCertificateDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.InvalidField.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.InvalidFieldWrapper.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.JSONObject.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.JSONPath.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.JSONPathWrapper.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Key.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.KlarnaInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Links.CustomTypeAdapterFactory()); @@ -184,6 +188,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri 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()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PaymentMethodWrapper.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PayoutSettings.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PayoutSettingsRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.PayoutSettingsResponse.CustomTypeAdapterFactory()); @@ -199,7 +204,6 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Settings.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.ShippingLocation.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.ShippingLocationsResponse.CustomTypeAdapterFactory()); - gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.ShopperStatement.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Signature.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.SofortInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Standalone.CustomTypeAdapterFactory()); @@ -225,6 +229,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.TestWebhookRequest.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.TestWebhookResponse.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.Timeouts.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.TwintInfo.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.UninstallAndroidAppDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.UninstallAndroidCertificateDetails.CustomTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.management.UpdatableAddress.CustomTypeAdapterFactory()); diff --git a/src/main/java/com/adyen/model/management/JSONObject.java b/src/main/java/com/adyen/model/management/JSONObject.java index a9375c1db..12767b03a 100644 --- a/src/main/java/com/adyen/model/management/JSONObject.java +++ b/src/main/java/com/adyen/model/management/JSONObject.java @@ -15,6 +15,7 @@ import java.util.Objects; import java.util.Arrays; import com.adyen.model.management.JSONPath; +import com.adyen.model.management.JSONPathWrapper; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -53,7 +56,7 @@ public class JSONObject { public static final String SERIALIZED_NAME_PATHS = "paths"; @SerializedName(SERIALIZED_NAME_PATHS) - private List paths = null; + private List paths = null; public static final String SERIALIZED_NAME_ROOT_PATH = "rootPath"; @SerializedName(SERIALIZED_NAME_ROOT_PATH) @@ -62,13 +65,13 @@ public class JSONObject { public JSONObject() { } - public JSONObject paths(List paths) { + public JSONObject paths(List paths) { this.paths = paths; return this; } - public JSONObject addPathsItem(JSONPath pathsItem) { + public JSONObject addPathsItem(JSONPathWrapper pathsItem) { if (this.paths == null) { this.paths = new ArrayList<>(); } @@ -82,12 +85,12 @@ public JSONObject addPathsItem(JSONPath pathsItem) { **/ @ApiModelProperty(value = "") - public List getPaths() { + public List getPaths() { return paths; } - public void setPaths(List paths) { + public void setPaths(List paths) { this.paths = paths; } @@ -167,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONObject.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties.", entry.getKey())); } } JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); @@ -199,7 +206,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()); + JSONPathWrapper.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); } } // validate the optional field `rootPath` diff --git a/src/main/java/com/adyen/model/management/JSONPath.java b/src/main/java/com/adyen/model/management/JSONPath.java index 12e7a3d12..deffc59d9 100644 --- a/src/main/java/com/adyen/model/management/JSONPath.java +++ b/src/main/java/com/adyen/model/management/JSONPath.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONPath.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,12 +163,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); + log.log(Level.WARNING, String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); } } diff --git a/src/main/java/com/adyen/model/management/JSONPathWrapper.java b/src/main/java/com/adyen/model/management/JSONPathWrapper.java new file mode 100644 index 000000000..8d790d0c9 --- /dev/null +++ b/src/main/java/com/adyen/model/management/JSONPathWrapper.java @@ -0,0 +1,215 @@ +/* + * 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.adyen.model.management.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 com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.management.JSON; + +/** + * JSONPathWrapper + */ + +public class JSONPathWrapper { + public static final String SERIALIZED_NAME_JS_O_N_PATH = "JSONPath"; + @SerializedName(SERIALIZED_NAME_JS_O_N_PATH) + private JSONPath jsONPath; + + public JSONPathWrapper() { + } + + public JSONPathWrapper jsONPath(JSONPath jsONPath) { + + this.jsONPath = jsONPath; + return this; + } + + /** + * Get jsONPath + * @return jsONPath + **/ + @ApiModelProperty(value = "") + + public JSONPath getJsONPath() { + return jsONPath; + } + + + public void setJsONPath(JSONPath jsONPath) { + this.jsONPath = jsONPath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JSONPathWrapper jsONPathWrapper = (JSONPathWrapper) o; + return Objects.equals(this.jsONPath, jsONPathWrapper.jsONPath); + } + + @Override + public int hashCode() { + return Objects.hash(jsONPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JSONPathWrapper {\n"); + sb.append(" jsONPath: ").append(toIndentedString(jsONPath)).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("JSONPath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONPathWrapper.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JSONPathWrapper + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JSONPathWrapper.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JSONPathWrapper is not found in the empty JSON string", JSONPathWrapper.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JSONPathWrapper.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPathWrapper` properties.", entry.getKey())); + } + } + // validate the optional field `JSONPath` + if (jsonObj.getAsJsonObject("JSONPath") != null) { + JSONPath.validateJsonObject(jsonObj.getAsJsonObject("JSONPath")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JSONPathWrapper.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JSONPathWrapper' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JSONPathWrapper.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JSONPathWrapper value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JSONPathWrapper read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JSONPathWrapper given an JSON string + * + * @param jsonString JSON string + * @return An instance of JSONPathWrapper + * @throws IOException if the JSON string is invalid with respect to JSONPathWrapper + */ + public static JSONPathWrapper fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JSONPathWrapper.class); + } + + /** + * Convert an instance of JSONPathWrapper to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/management/Key.java b/src/main/java/com/adyen/model/management/Key.java index be4a2e0bd..6ad31628e 100644 --- a/src/main/java/com/adyen/model/management/Key.java +++ b/src/main/java/com/adyen/model/management/Key.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Key.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,16 +211,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Key.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Key` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Key` properties.", entry.getKey())); } } // validate the optional field identifier if (jsonObj.get("identifier") != null && !jsonObj.get("identifier").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); + log.log(Level.WARNING, String.format("Expected the field `identifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("identifier").toString())); } // validate the optional field passphrase if (jsonObj.get("passphrase") != null && !jsonObj.get("passphrase").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `passphrase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passphrase").toString())); + log.log(Level.WARNING, String.format("Expected the field `passphrase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("passphrase").toString())); } } diff --git a/src/main/java/com/adyen/model/management/KlarnaInfo.java b/src/main/java/com/adyen/model/management/KlarnaInfo.java index bf09f8bd9..2a9a6b033 100644 --- a/src/main/java/com/adyen/model/management/KlarnaInfo.java +++ b/src/main/java/com/adyen/model/management/KlarnaInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -267,6 +269,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("disputeEmail"); openapiRequiredFields.add("supportEmail"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(KlarnaInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -287,7 +293,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!KlarnaInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `KlarnaInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `KlarnaInfo` properties.", entry.getKey())); } } @@ -299,7 +305,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field disputeEmail if (jsonObj.get("disputeEmail") != null && !jsonObj.get("disputeEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `disputeEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("disputeEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `disputeEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("disputeEmail").toString())); } // ensure the field region can be parsed to an enum value if (jsonObj.get("region") != null) { @@ -310,7 +316,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field supportEmail if (jsonObj.get("supportEmail") != null && !jsonObj.get("supportEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `supportEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("supportEmail").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Links.java b/src/main/java/com/adyen/model/management/Links.java index ef0b379c3..eac48126d 100644 --- a/src/main/java/com/adyen/model/management/Links.java +++ b/src/main/java/com/adyen/model/management/Links.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("self"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Links.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Links.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Links` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Links` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/LinksElement.java b/src/main/java/com/adyen/model/management/LinksElement.java index b20adf256..d505d0abb 100644 --- a/src/main/java/com/adyen/model/management/LinksElement.java +++ b/src/main/java/com/adyen/model/management/LinksElement.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(LinksElement.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!LinksElement.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `LinksElement` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `LinksElement` properties.", entry.getKey())); } } // validate the optional field href if (jsonObj.get("href") != null && !jsonObj.get("href").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); + log.log(Level.WARNING, String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java b/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java index 5fdddb27c..fdd8c7bf5 100644 --- a/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java +++ b/src/main/java/com/adyen/model/management/ListCompanyApiCredentialsResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListCompanyApiCredentialsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListCompanyApiCredentialsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListCompanyApiCredentialsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListCompanyApiCredentialsResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListCompanyResponse.java b/src/main/java/com/adyen/model/management/ListCompanyResponse.java index 6db204748..eb11d53bf 100644 --- a/src/main/java/com/adyen/model/management/ListCompanyResponse.java +++ b/src/main/java/com/adyen/model/management/ListCompanyResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListCompanyResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListCompanyResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListCompanyResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListCompanyResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java b/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java index 463bdf01f..34d8133f2 100644 --- a/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java +++ b/src/main/java/com/adyen/model/management/ListCompanyUsersResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListCompanyUsersResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListCompanyUsersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListCompanyUsersResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListCompanyUsersResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java b/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java index 5b29ca544..1734f5f6d 100644 --- a/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java +++ b/src/main/java/com/adyen/model/management/ListExternalTerminalActionsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListExternalTerminalActionsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListExternalTerminalActionsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListExternalTerminalActionsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListExternalTerminalActionsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java b/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java index 98507e5bd..e57f8d27b 100644 --- a/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java +++ b/src/main/java/com/adyen/model/management/ListMerchantApiCredentialsResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListMerchantApiCredentialsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListMerchantApiCredentialsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListMerchantApiCredentialsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListMerchantApiCredentialsResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListMerchantResponse.java b/src/main/java/com/adyen/model/management/ListMerchantResponse.java index 2599bf8ce..af707e98d 100644 --- a/src/main/java/com/adyen/model/management/ListMerchantResponse.java +++ b/src/main/java/com/adyen/model/management/ListMerchantResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListMerchantResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListMerchantResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListMerchantResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListMerchantResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java b/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java index 180b85b22..582584f62 100644 --- a/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java +++ b/src/main/java/com/adyen/model/management/ListMerchantUsersResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListMerchantUsersResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListMerchantUsersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListMerchantUsersResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListMerchantUsersResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListStoresResponse.java b/src/main/java/com/adyen/model/management/ListStoresResponse.java index 6a262c651..2fddb9deb 100644 --- a/src/main/java/com/adyen/model/management/ListStoresResponse.java +++ b/src/main/java/com/adyen/model/management/ListStoresResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListStoresResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListStoresResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListStoresResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListStoresResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/ListTerminalsResponse.java b/src/main/java/com/adyen/model/management/ListTerminalsResponse.java index 07d9bec49..dc8feaa4d 100644 --- a/src/main/java/com/adyen/model/management/ListTerminalsResponse.java +++ b/src/main/java/com/adyen/model/management/ListTerminalsResponse.java @@ -14,6 +14,7 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.management.PaginationLinks; import com.adyen.model.management.Terminal; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -51,13 +54,47 @@ */ public class ListTerminalsResponse { + public static final String SERIALIZED_NAME_LINKS = "_links"; + @SerializedName(SERIALIZED_NAME_LINKS) + private PaginationLinks links; + public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) private List data = null; + public static final String SERIALIZED_NAME_ITEMS_TOTAL = "itemsTotal"; + @SerializedName(SERIALIZED_NAME_ITEMS_TOTAL) + private Integer itemsTotal; + + public static final String SERIALIZED_NAME_PAGES_TOTAL = "pagesTotal"; + @SerializedName(SERIALIZED_NAME_PAGES_TOTAL) + private Integer pagesTotal; + public ListTerminalsResponse() { } + public ListTerminalsResponse links(PaginationLinks links) { + + this.links = links; + return this; + } + + /** + * Get links + * @return links + **/ + @ApiModelProperty(value = "") + + public PaginationLinks getLinks() { + return links; + } + + + public void setLinks(PaginationLinks links) { + this.links = links; + } + + public ListTerminalsResponse data(List data) { this.data = data; @@ -88,6 +125,50 @@ public void setData(List data) { } + public ListTerminalsResponse itemsTotal(Integer itemsTotal) { + + this.itemsTotal = itemsTotal; + return this; + } + + /** + * Total number of items. + * @return itemsTotal + **/ + @ApiModelProperty(required = true, value = "Total number of items.") + + public Integer getItemsTotal() { + return itemsTotal; + } + + + public void setItemsTotal(Integer itemsTotal) { + this.itemsTotal = itemsTotal; + } + + + public ListTerminalsResponse pagesTotal(Integer pagesTotal) { + + this.pagesTotal = pagesTotal; + return this; + } + + /** + * Total number of pages. + * @return pagesTotal + **/ + @ApiModelProperty(required = true, value = "Total number of pages.") + + public Integer getPagesTotal() { + return pagesTotal; + } + + + public void setPagesTotal(Integer pagesTotal) { + this.pagesTotal = pagesTotal; + } + + @Override public boolean equals(Object o) { @@ -98,19 +179,25 @@ public boolean equals(Object o) { return false; } ListTerminalsResponse listTerminalsResponse = (ListTerminalsResponse) o; - return Objects.equals(this.data, listTerminalsResponse.data); + return Objects.equals(this.links, listTerminalsResponse.links) && + Objects.equals(this.data, listTerminalsResponse.data) && + Objects.equals(this.itemsTotal, listTerminalsResponse.itemsTotal) && + Objects.equals(this.pagesTotal, listTerminalsResponse.pagesTotal); } @Override public int hashCode() { - return Objects.hash(data); + return Objects.hash(links, data, itemsTotal, pagesTotal); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ListTerminalsResponse {\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" itemsTotal: ").append(toIndentedString(itemsTotal)).append("\n"); + sb.append(" pagesTotal: ").append(toIndentedString(pagesTotal)).append("\n"); sb.append("}"); return sb.toString(); } @@ -133,11 +220,20 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("_links"); openapiFields.add("data"); + openapiFields.add("itemsTotal"); + openapiFields.add("pagesTotal"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("itemsTotal"); + openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListTerminalsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,9 +254,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListTerminalsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListTerminalsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListTerminalsResponse` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ListTerminalsResponse.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 `_links` + if (jsonObj.getAsJsonObject("_links") != null) { + PaginationLinks.validateJsonObject(jsonObj.getAsJsonObject("_links")); + } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); if (jsonArraydata != null) { // ensure the json data is an array diff --git a/src/main/java/com/adyen/model/management/ListWebhooksResponse.java b/src/main/java/com/adyen/model/management/ListWebhooksResponse.java index 03e53b4c6..b68358c43 100644 --- a/src/main/java/com/adyen/model/management/ListWebhooksResponse.java +++ b/src/main/java/com/adyen/model/management/ListWebhooksResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -257,6 +259,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ListWebhooksResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -277,7 +283,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ListWebhooksResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ListWebhooksResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ListWebhooksResponse` properties.", entry.getKey())); } } @@ -293,7 +299,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field accountReference if (jsonObj.get("accountReference") != null && !jsonObj.get("accountReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `accountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountReference").toString())); } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); if (jsonArraydata != null) { diff --git a/src/main/java/com/adyen/model/management/Logo.java b/src/main/java/com/adyen/model/management/Logo.java index c83c49f64..3f4330e41 100644 --- a/src/main/java/com/adyen/model/management/Logo.java +++ b/src/main/java/com/adyen/model/management/Logo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Logo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Logo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Logo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Logo` properties.", entry.getKey())); } } // validate the optional field data if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + log.log(Level.WARNING, String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); } } diff --git a/src/main/java/com/adyen/model/management/MeApiCredential.java b/src/main/java/com/adyen/model/management/MeApiCredential.java index e37eea7c6..e8578d564 100644 --- a/src/main/java/com/adyen/model/management/MeApiCredential.java +++ b/src/main/java/com/adyen/model/management/MeApiCredential.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -453,6 +455,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("roles"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MeApiCredential.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -473,7 +479,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MeApiCredential.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MeApiCredential` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MeApiCredential` properties.", entry.getKey())); } } @@ -489,7 +495,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("allowedIpAddresses") != null && !jsonObj.get("allowedIpAddresses").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedIpAddresses` to be an array in the JSON string but got `%s`", jsonObj.get("allowedIpAddresses").toString())); } JsonArray jsonArrayallowedOrigins = jsonObj.getAsJsonArray("allowedOrigins"); if (jsonArrayallowedOrigins != null) { @@ -505,31 +511,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").toString())); } // validate the optional field clientKey if (jsonObj.get("clientKey") != null && !jsonObj.get("clientKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `clientKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientKey").toString())); } // validate the optional field companyName if (jsonObj.get("companyName") != null && !jsonObj.get("companyName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyName").toString())); + log.log(Level.WARNING, String.format("Expected the field `companyName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyName").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java b/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java index c0b2d0f4f..7f4bb6ccb 100644 --- a/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java +++ b/src/main/java/com/adyen/model/management/MealVoucherFRInfo.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -195,6 +197,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("siret"); openapiRequiredFields.add("subTypes"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MealVoucherFRInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -215,7 +221,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MealVoucherFRInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MealVoucherFRInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MealVoucherFRInfo` properties.", entry.getKey())); } } @@ -227,15 +233,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field conecsId if (jsonObj.get("conecsId") != null && !jsonObj.get("conecsId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `conecsId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conecsId").toString())); + log.log(Level.WARNING, String.format("Expected the field `conecsId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("conecsId").toString())); } // validate the optional field siret if (jsonObj.get("siret") != null && !jsonObj.get("siret").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `siret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("siret").toString())); + log.log(Level.WARNING, String.format("Expected the field `siret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("siret").toString())); } // ensure the json data is an array if (jsonObj.get("subTypes") != null && !jsonObj.get("subTypes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `subTypes` to be an array in the JSON string but got `%s`", jsonObj.get("subTypes").toString())); + log.log(Level.WARNING, String.format("Expected the field `subTypes` to be an array in the JSON string but got `%s`", jsonObj.get("subTypes").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Merchant.java b/src/main/java/com/adyen/model/management/Merchant.java index 172be8769..eb56da275 100644 --- a/src/main/java/com/adyen/model/management/Merchant.java +++ b/src/main/java/com/adyen/model/management/Merchant.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -516,6 +518,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Merchant.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -536,7 +542,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Merchant.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Merchant` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Merchant` properties.", entry.getKey())); } } // validate the optional field `_links` @@ -545,11 +551,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field captureDelay if (jsonObj.get("captureDelay") != null && !jsonObj.get("captureDelay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `captureDelay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("captureDelay").toString())); + log.log(Level.WARNING, String.format("Expected the field `captureDelay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("captureDelay").toString())); } // validate the optional field companyId if (jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + log.log(Level.WARNING, String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); } JsonArray jsonArraydataCenters = jsonObj.getAsJsonArray("dataCenters"); if (jsonArraydataCenters != null) { @@ -565,43 +571,43 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field defaultShopperInteraction if (jsonObj.get("defaultShopperInteraction") != null && !jsonObj.get("defaultShopperInteraction").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `defaultShopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultShopperInteraction").toString())); + log.log(Level.WARNING, String.format("Expected the field `defaultShopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultShopperInteraction").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field merchantCity if (jsonObj.get("merchantCity") != null && !jsonObj.get("merchantCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantCity").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field pricingPlan if (jsonObj.get("pricingPlan") != null && !jsonObj.get("pricingPlan").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `pricingPlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricingPlan").toString())); + log.log(Level.WARNING, String.format("Expected the field `pricingPlan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pricingPlan").toString())); } // validate the optional field primarySettlementCurrency if (jsonObj.get("primarySettlementCurrency") != null && !jsonObj.get("primarySettlementCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `primarySettlementCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primarySettlementCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `primarySettlementCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primarySettlementCurrency").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())); + log.log(Level.WARNING, 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 shopWebAddress if (jsonObj.get("shopWebAddress") != null && !jsonObj.get("shopWebAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopWebAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopWebAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopWebAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopWebAddress").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())); + log.log(Level.WARNING, String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } diff --git a/src/main/java/com/adyen/model/management/MerchantLinks.java b/src/main/java/com/adyen/model/management/MerchantLinks.java index b3c2d348a..cd4b69412 100644 --- a/src/main/java/com/adyen/model/management/MerchantLinks.java +++ b/src/main/java/com/adyen/model/management/MerchantLinks.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -216,6 +218,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("self"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantLinks.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -236,7 +242,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantLinks.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantLinks` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantLinks` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/MinorUnitsMonetaryValue.java b/src/main/java/com/adyen/model/management/MinorUnitsMonetaryValue.java index b60999824..ee04a4c87 100644 --- a/src/main/java/com/adyen/model/management/MinorUnitsMonetaryValue.java +++ b/src/main/java/com/adyen/model/management/MinorUnitsMonetaryValue.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MinorUnitsMonetaryValue.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,12 +182,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MinorUnitsMonetaryValue.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MinorUnitsMonetaryValue` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MinorUnitsMonetaryValue` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currencyCode").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ModelConfiguration.java b/src/main/java/com/adyen/model/management/ModelConfiguration.java index 894f54ed8..b83bb49cc 100644 --- a/src/main/java/com/adyen/model/management/ModelConfiguration.java +++ b/src/main/java/com/adyen/model/management/ModelConfiguration.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("brand"); openapiRequiredFields.add("currencies"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ModelConfiguration.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ModelConfiguration.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ModelConfiguration` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field brand if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); } JsonArray jsonArraycurrencies = jsonObj.getAsJsonArray("currencies"); if (jsonArraycurrencies != null) { @@ -251,7 +257,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("sources") != null && !jsonObj.get("sources").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sources` to be an array in the JSON string but got `%s`", jsonObj.get("sources").toString())); + log.log(Level.WARNING, String.format("Expected the field `sources` to be an array in the JSON string but got `%s`", jsonObj.get("sources").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ModelFile.java b/src/main/java/com/adyen/model/management/ModelFile.java index c1f67639d..e8c84e908 100644 --- a/src/main/java/com/adyen/model/management/ModelFile.java +++ b/src/main/java/com/adyen/model/management/ModelFile.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("data"); openapiRequiredFields.add("name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ModelFile.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ModelFile.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field data if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").toString())); + log.log(Level.WARNING, String.format("Expected the field `data` to be a primitive type in the JSON string but got `%s`", jsonObj.get("data").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Name.java b/src/main/java/com/adyen/model/management/Name.java index 01e781978..fddaefd15 100644 --- a/src/main/java/com/adyen/model/management/Name.java +++ b/src/main/java/com/adyen/model/management/Name.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Name2.java b/src/main/java/com/adyen/model/management/Name2.java index 66770086e..22a9b8f11 100644 --- a/src/main/java/com/adyen/model/management/Name2.java +++ b/src/main/java/com/adyen/model/management/Name2.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name2.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name2` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Nexo.java b/src/main/java/com/adyen/model/management/Nexo.java index 16eb458f8..36a1a0975 100644 --- a/src/main/java/com/adyen/model/management/Nexo.java +++ b/src/main/java/com/adyen/model/management/Nexo.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -232,6 +234,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Nexo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -252,7 +258,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Nexo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Nexo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Nexo` properties.", entry.getKey())); } } // validate the optional field `displayUrls` @@ -269,7 +275,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("nexoEventUrls") != null && !jsonObj.get("nexoEventUrls").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `nexoEventUrls` to be an array in the JSON string but got `%s`", jsonObj.get("nexoEventUrls").toString())); + log.log(Level.WARNING, String.format("Expected the field `nexoEventUrls` to be an array in the JSON string but got `%s`", jsonObj.get("nexoEventUrls").toString())); } } diff --git a/src/main/java/com/adyen/model/management/NotificationUrl.java b/src/main/java/com/adyen/model/management/NotificationUrl.java index 23f8e4fd4..791f91d19 100644 --- a/src/main/java/com/adyen/model/management/NotificationUrl.java +++ b/src/main/java/com/adyen/model/management/NotificationUrl.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -175,6 +177,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NotificationUrl.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -195,7 +201,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!NotificationUrl.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotificationUrl` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NotificationUrl` properties.", entry.getKey())); } } JsonArray jsonArraylocalUrls = jsonObj.getAsJsonArray("localUrls"); diff --git a/src/main/java/com/adyen/model/management/OfflineProcessing.java b/src/main/java/com/adyen/model/management/OfflineProcessing.java index 183191c48..969ed578e 100644 --- a/src/main/java/com/adyen/model/management/OfflineProcessing.java +++ b/src/main/java/com/adyen/model/management/OfflineProcessing.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OfflineProcessing.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OfflineProcessing.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OfflineProcessing` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OfflineProcessing` properties.", entry.getKey())); } } JsonArray jsonArrayofflineSwipeLimits = jsonObj.getAsJsonArray("offlineSwipeLimits"); diff --git a/src/main/java/com/adyen/model/management/Opi.java b/src/main/java/com/adyen/model/management/Opi.java index 7f214ecc5..7eb667afa 100644 --- a/src/main/java/com/adyen/model/management/Opi.java +++ b/src/main/java/com/adyen/model/management/Opi.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Opi.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,16 +211,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Opi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Opi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Opi` properties.", entry.getKey())); } } // validate the optional field payAtTableStoreNumber if (jsonObj.get("payAtTableStoreNumber") != null && !jsonObj.get("payAtTableStoreNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payAtTableStoreNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payAtTableStoreNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `payAtTableStoreNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payAtTableStoreNumber").toString())); } // validate the optional field payAtTableURL if (jsonObj.get("payAtTableURL") != null && !jsonObj.get("payAtTableURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payAtTableURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payAtTableURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `payAtTableURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payAtTableURL").toString())); } } diff --git a/src/main/java/com/adyen/model/management/OrderItem.java b/src/main/java/com/adyen/model/management/OrderItem.java index cf70a87e9..ca4ba40ae 100644 --- a/src/main/java/com/adyen/model/management/OrderItem.java +++ b/src/main/java/com/adyen/model/management/OrderItem.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(OrderItem.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,16 +240,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!OrderItem.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OrderItem` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `OrderItem` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/management/PaginationLinks.java b/src/main/java/com/adyen/model/management/PaginationLinks.java index 1fa8f2209..a87f3be07 100644 --- a/src/main/java/com/adyen/model/management/PaginationLinks.java +++ b/src/main/java/com/adyen/model/management/PaginationLinks.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -247,6 +249,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("last"); openapiRequiredFields.add("self"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaginationLinks.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -267,7 +273,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaginationLinks.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaginationLinks` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaginationLinks` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/Passcodes.java b/src/main/java/com/adyen/model/management/Passcodes.java index 1d4ab3b1c..3fed8a34e 100644 --- a/src/main/java/com/adyen/model/management/Passcodes.java +++ b/src/main/java/com/adyen/model/management/Passcodes.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Passcodes.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,24 +240,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Passcodes.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Passcodes` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Passcodes` properties.", entry.getKey())); } } // validate the optional field adminMenuPin if (jsonObj.get("adminMenuPin") != null && !jsonObj.get("adminMenuPin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `adminMenuPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("adminMenuPin").toString())); + log.log(Level.WARNING, String.format("Expected the field `adminMenuPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("adminMenuPin").toString())); } // validate the optional field refundPin if (jsonObj.get("refundPin") != null && !jsonObj.get("refundPin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refundPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refundPin").toString())); + log.log(Level.WARNING, String.format("Expected the field `refundPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refundPin").toString())); } // validate the optional field screenLockPin if (jsonObj.get("screenLockPin") != null && !jsonObj.get("screenLockPin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `screenLockPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("screenLockPin").toString())); + log.log(Level.WARNING, String.format("Expected the field `screenLockPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("screenLockPin").toString())); } // validate the optional field txMenuPin if (jsonObj.get("txMenuPin") != null && !jsonObj.get("txMenuPin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txMenuPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txMenuPin").toString())); + log.log(Level.WARNING, String.format("Expected the field `txMenuPin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txMenuPin").toString())); } } diff --git a/src/main/java/com/adyen/model/management/PayAtTable.java b/src/main/java/com/adyen/model/management/PayAtTable.java index 7d12d63cd..424ba2d26 100644 --- a/src/main/java/com/adyen/model/management/PayAtTable.java +++ b/src/main/java/com/adyen/model/management/PayAtTable.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayAtTable.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayAtTable` properties.", entry.getKey())); } } // ensure the field authenticationMethod can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/management/PayPalInfo.java b/src/main/java/com/adyen/model/management/PayPalInfo.java index b2c63a48e..03754aa04 100644 --- a/src/main/java/com/adyen/model/management/PayPalInfo.java +++ b/src/main/java/com/adyen/model/management/PayPalInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("payerId"); openapiRequiredFields.add("subject"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayPalInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayPalInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayPalInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayPalInfo` properties.", entry.getKey())); } } @@ -219,11 +225,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field payerId if (jsonObj.get("payerId") != null && !jsonObj.get("payerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payerId").toString())); + log.log(Level.WARNING, String.format("Expected the field `payerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payerId").toString())); } // validate the optional field subject if (jsonObj.get("subject") != null && !jsonObj.get("subject").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); + log.log(Level.WARNING, String.format("Expected the field `subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subject").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Payment.java b/src/main/java/com/adyen/model/management/Payment.java index 2b69d9b8e..89870b15d 100644 --- a/src/main/java/com/adyen/model/management/Payment.java +++ b/src/main/java/com/adyen/model/management/Payment.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Payment.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,12 +163,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Payment` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `hideMinorUnitsInCurrencies` to be an array in the JSON string but got `%s`", jsonObj.get("hideMinorUnitsInCurrencies").toString())); } } diff --git a/src/main/java/com/adyen/model/management/PaymentMethod.java b/src/main/java/com/adyen/model/management/PaymentMethod.java index 5d9b38c6d..9dbe4b8e0 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethod.java +++ b/src/main/java/com/adyen/model/management/PaymentMethod.java @@ -14,9 +14,11 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.management.AfterpayTouchInfo; import com.adyen.model.management.ApplePayInfo; import com.adyen.model.management.BcmcInfo; import com.adyen.model.management.CartesBancairesInfo; +import com.adyen.model.management.ClearpayInfo; import com.adyen.model.management.GiroPayInfo; import com.adyen.model.management.GooglePayInfo; import com.adyen.model.management.KlarnaInfo; @@ -24,6 +26,7 @@ import com.adyen.model.management.PayPalInfo; import com.adyen.model.management.SofortInfo; import com.adyen.model.management.SwishInfo; +import com.adyen.model.management.TwintInfo; import com.adyen.model.management.VippsInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -53,6 +56,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -61,6 +66,10 @@ */ public class PaymentMethod { + public static final String SERIALIZED_NAME_AFTERPAY_TOUCH = "afterpayTouch"; + @SerializedName(SERIALIZED_NAME_AFTERPAY_TOUCH) + private AfterpayTouchInfo afterpayTouch; + public static final String SERIALIZED_NAME_ALLOWED = "allowed"; @SerializedName(SERIALIZED_NAME_ALLOWED) private Boolean allowed; @@ -81,6 +90,10 @@ public class PaymentMethod { @SerializedName(SERIALIZED_NAME_CARTES_BANCAIRES) private CartesBancairesInfo cartesBancaires; + public static final String SERIALIZED_NAME_CLEARPAY = "clearpay"; + @SerializedName(SERIALIZED_NAME_CLEARPAY) + private ClearpayInfo clearpay; + public static final String SERIALIZED_NAME_COUNTRIES = "countries"; @SerializedName(SERIALIZED_NAME_COUNTRIES) private List countries = null; @@ -141,6 +154,10 @@ public class PaymentMethod { @SerializedName(SERIALIZED_NAME_SWISH) private SwishInfo swish; + public static final String SERIALIZED_NAME_TWINT = "twint"; + @SerializedName(SERIALIZED_NAME_TWINT) + private TwintInfo twint; + public static final String SERIALIZED_NAME_TYPE = "type"; @SerializedName(SERIALIZED_NAME_TYPE) private String type; @@ -207,6 +224,28 @@ public VerificationStatusEnum read(final JsonReader jsonReader) throws IOExcepti public PaymentMethod() { } + public PaymentMethod afterpayTouch(AfterpayTouchInfo afterpayTouch) { + + this.afterpayTouch = afterpayTouch; + return this; + } + + /** + * Get afterpayTouch + * @return afterpayTouch + **/ + @ApiModelProperty(value = "") + + public AfterpayTouchInfo getAfterpayTouch() { + return afterpayTouch; + } + + + public void setAfterpayTouch(AfterpayTouchInfo afterpayTouch) { + this.afterpayTouch = afterpayTouch; + } + + public PaymentMethod allowed(Boolean allowed) { this.allowed = allowed; @@ -317,6 +356,28 @@ public void setCartesBancaires(CartesBancairesInfo cartesBancaires) { } + public PaymentMethod clearpay(ClearpayInfo clearpay) { + + this.clearpay = clearpay; + return this; + } + + /** + * Get clearpay + * @return clearpay + **/ + @ApiModelProperty(value = "") + + public ClearpayInfo getClearpay() { + return clearpay; + } + + + public void setClearpay(ClearpayInfo clearpay) { + this.clearpay = clearpay; + } + + public PaymentMethod countries(List countries) { this.countries = countries; @@ -671,6 +732,28 @@ public void setSwish(SwishInfo swish) { } + public PaymentMethod twint(TwintInfo twint) { + + this.twint = twint; + return this; + } + + /** + * Get twint + * @return twint + **/ + @ApiModelProperty(value = "") + + public TwintInfo getTwint() { + return twint; + } + + + public void setTwint(TwintInfo twint) { + this.twint = twint; + } + + public PaymentMethod type(String type) { this.type = type; @@ -747,11 +830,13 @@ public boolean equals(Object o) { return false; } PaymentMethod paymentMethod = (PaymentMethod) o; - return Objects.equals(this.allowed, paymentMethod.allowed) && + return Objects.equals(this.afterpayTouch, paymentMethod.afterpayTouch) && + Objects.equals(this.allowed, paymentMethod.allowed) && Objects.equals(this.applePay, paymentMethod.applePay) && Objects.equals(this.bcmc, paymentMethod.bcmc) && Objects.equals(this.businessLineId, paymentMethod.businessLineId) && Objects.equals(this.cartesBancaires, paymentMethod.cartesBancaires) && + Objects.equals(this.clearpay, paymentMethod.clearpay) && Objects.equals(this.countries, paymentMethod.countries) && Objects.equals(this.currencies, paymentMethod.currencies) && Objects.equals(this.customRoutingFlags, paymentMethod.customRoutingFlags) && @@ -767,6 +852,7 @@ public boolean equals(Object o) { Objects.equals(this.sofort, paymentMethod.sofort) && Objects.equals(this.storeId, paymentMethod.storeId) && Objects.equals(this.swish, paymentMethod.swish) && + Objects.equals(this.twint, paymentMethod.twint) && Objects.equals(this.type, paymentMethod.type) && Objects.equals(this.verificationStatus, paymentMethod.verificationStatus) && Objects.equals(this.vipps, paymentMethod.vipps); @@ -774,18 +860,20 @@ public boolean equals(Object o) { @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, vipps); + return Objects.hash(afterpayTouch, allowed, applePay, bcmc, businessLineId, cartesBancaires, clearpay, countries, currencies, customRoutingFlags, enabled, giroPay, googlePay, id, klarna, mealVoucherFR, paypal, reference, shopperInteraction, sofort, storeId, swish, twint, type, verificationStatus, vipps); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaymentMethod {\n"); + sb.append(" afterpayTouch: ").append(toIndentedString(afterpayTouch)).append("\n"); sb.append(" allowed: ").append(toIndentedString(allowed)).append("\n"); sb.append(" applePay: ").append(toIndentedString(applePay)).append("\n"); sb.append(" bcmc: ").append(toIndentedString(bcmc)).append("\n"); sb.append(" businessLineId: ").append(toIndentedString(businessLineId)).append("\n"); sb.append(" cartesBancaires: ").append(toIndentedString(cartesBancaires)).append("\n"); + sb.append(" clearpay: ").append(toIndentedString(clearpay)).append("\n"); sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); sb.append(" currencies: ").append(toIndentedString(currencies)).append("\n"); sb.append(" customRoutingFlags: ").append(toIndentedString(customRoutingFlags)).append("\n"); @@ -801,6 +889,7 @@ public String toString() { sb.append(" sofort: ").append(toIndentedString(sofort)).append("\n"); sb.append(" storeId: ").append(toIndentedString(storeId)).append("\n"); sb.append(" swish: ").append(toIndentedString(swish)).append("\n"); + sb.append(" twint: ").append(toIndentedString(twint)).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"); @@ -826,11 +915,13 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("afterpayTouch"); openapiFields.add("allowed"); openapiFields.add("applePay"); openapiFields.add("bcmc"); openapiFields.add("businessLineId"); openapiFields.add("cartesBancaires"); + openapiFields.add("clearpay"); openapiFields.add("countries"); openapiFields.add("currencies"); openapiFields.add("customRoutingFlags"); @@ -846,6 +937,7 @@ private String toIndentedString(Object o) { openapiFields.add("sofort"); openapiFields.add("storeId"); openapiFields.add("swish"); + openapiFields.add("twint"); openapiFields.add("type"); openapiFields.add("verificationStatus"); openapiFields.add("vipps"); @@ -854,6 +946,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("id"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethod.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -874,7 +970,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethod.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethod` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethod` properties.", entry.getKey())); } } @@ -884,6 +980,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 `afterpayTouch` + if (jsonObj.getAsJsonObject("afterpayTouch") != null) { + AfterpayTouchInfo.validateJsonObject(jsonObj.getAsJsonObject("afterpayTouch")); + } // validate the optional field `applePay` if (jsonObj.getAsJsonObject("applePay") != null) { ApplePayInfo.validateJsonObject(jsonObj.getAsJsonObject("applePay")); @@ -894,23 +994,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field businessLineId if (jsonObj.get("businessLineId") != null && !jsonObj.get("businessLineId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); } // validate the optional field `cartesBancaires` if (jsonObj.getAsJsonObject("cartesBancaires") != null) { CartesBancairesInfo.validateJsonObject(jsonObj.getAsJsonObject("cartesBancaires")); } + // validate the optional field `clearpay` + if (jsonObj.getAsJsonObject("clearpay") != null) { + ClearpayInfo.validateJsonObject(jsonObj.getAsJsonObject("clearpay")); + } // ensure the json data is an array if (jsonObj.get("countries") != null && !jsonObj.get("countries").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `countries` to be an array in the JSON string but got `%s`", jsonObj.get("countries").toString())); + log.log(Level.WARNING, String.format("Expected the field `countries` to be an array in the JSON string but got `%s`", jsonObj.get("countries").toString())); } // ensure the json data is an array if (jsonObj.get("currencies") != null && !jsonObj.get("currencies").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `currencies` to be an array in the JSON string but got `%s`", jsonObj.get("currencies").toString())); + log.log(Level.WARNING, String.format("Expected the field `currencies` to be an array in the JSON string but got `%s`", jsonObj.get("currencies").toString())); } // ensure the json data is an array if (jsonObj.get("customRoutingFlags") != null && !jsonObj.get("customRoutingFlags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `customRoutingFlags` to be an array in the JSON string but got `%s`", jsonObj.get("customRoutingFlags").toString())); + log.log(Level.WARNING, String.format("Expected the field `customRoutingFlags` to be an array in the JSON string but got `%s`", jsonObj.get("customRoutingFlags").toString())); } // validate the optional field `giroPay` if (jsonObj.getAsJsonObject("giroPay") != null) { @@ -922,7 +1026,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `klarna` if (jsonObj.getAsJsonObject("klarna") != null) { @@ -938,11 +1042,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperInteraction if (jsonObj.get("shopperInteraction") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); } // validate the optional field `sofort` if (jsonObj.getAsJsonObject("sofort") != null) { @@ -950,15 +1054,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field storeId if (jsonObj.get("storeId") != null && !jsonObj.get("storeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); } // validate the optional field `swish` if (jsonObj.getAsJsonObject("swish") != null) { SwishInfo.validateJsonObject(jsonObj.getAsJsonObject("swish")); } + // validate the optional field `twint` + if (jsonObj.getAsJsonObject("twint") != null) { + TwintInfo.validateJsonObject(jsonObj.getAsJsonObject("twint")); + } // 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // 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/management/PaymentMethodResponse.java b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java index 5454d7984..03cbd215e 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodResponse.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodResponse.java @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; import com.adyen.model.management.PaginationLinks; -import com.adyen.model.management.PaymentMethod; +import com.adyen.model.management.PaymentMethodWrapper; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -58,7 +60,7 @@ public class PaymentMethodResponse { public static final String SERIALIZED_NAME_DATA = "data"; @SerializedName(SERIALIZED_NAME_DATA) - private List data = null; + private List data = null; public static final String SERIALIZED_NAME_ITEMS_TOTAL = "itemsTotal"; @SerializedName(SERIALIZED_NAME_ITEMS_TOTAL) @@ -157,6 +159,10 @@ public enum TypesWithErrorsEnum { TRUSTLY("trustly"), + TWINT("twint"), + + TWINT_POS("twint_pos"), + VIPPS("vipps"), VISA("visa"), @@ -236,13 +242,13 @@ public void setLinks(PaginationLinks links) { } - public PaymentMethodResponse data(List data) { + public PaymentMethodResponse data(List data) { this.data = data; return this; } - public PaymentMethodResponse addDataItem(PaymentMethod dataItem) { + public PaymentMethodResponse addDataItem(PaymentMethodWrapper dataItem) { if (this.data == null) { this.data = new ArrayList<>(); } @@ -256,12 +262,12 @@ public PaymentMethodResponse addDataItem(PaymentMethod dataItem) { **/ @ApiModelProperty(value = "Payment methods details.") - public List getData() { + public List getData() { return data; } - public void setData(List data) { + public void setData(List data) { this.data = data; } @@ -404,6 +410,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("itemsTotal"); openapiRequiredFields.add("pagesTotal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -424,7 +434,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethodResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodResponse` properties.", entry.getKey())); } } @@ -447,12 +457,12 @@ 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()); + PaymentMethodWrapper.validateJsonObject(jsonArraydata.get(i).getAsJsonObject()); } } // ensure the json data is an array if (jsonObj.get("typesWithErrors") != null && !jsonObj.get("typesWithErrors").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `typesWithErrors` to be an array in the JSON string but got `%s`", jsonObj.get("typesWithErrors").toString())); + log.log(Level.WARNING, String.format("Expected the field `typesWithErrors` to be an array in the JSON string but got `%s`", jsonObj.get("typesWithErrors").toString())); } } diff --git a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java index 344e85cdd..7fda62831 100644 --- a/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java +++ b/src/main/java/com/adyen/model/management/PaymentMethodSetupInfo.java @@ -14,9 +14,11 @@ import java.util.Objects; import java.util.Arrays; +import com.adyen.model.management.AfterpayTouchInfo; import com.adyen.model.management.ApplePayInfo; import com.adyen.model.management.BcmcInfo; import com.adyen.model.management.CartesBancairesInfo; +import com.adyen.model.management.ClearpayInfo; import com.adyen.model.management.GiroPayInfo; import com.adyen.model.management.GooglePayInfo; import com.adyen.model.management.KlarnaInfo; @@ -24,6 +26,7 @@ import com.adyen.model.management.PayPalInfo; import com.adyen.model.management.SofortInfo; import com.adyen.model.management.SwishInfo; +import com.adyen.model.management.TwintInfo; import com.adyen.model.management.VippsInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -53,6 +56,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -61,6 +66,10 @@ */ public class PaymentMethodSetupInfo { + public static final String SERIALIZED_NAME_AFTERPAY_TOUCH = "afterpayTouch"; + @SerializedName(SERIALIZED_NAME_AFTERPAY_TOUCH) + private AfterpayTouchInfo afterpayTouch; + public static final String SERIALIZED_NAME_APPLE_PAY = "applePay"; @SerializedName(SERIALIZED_NAME_APPLE_PAY) private ApplePayInfo applePay; @@ -77,6 +86,10 @@ public class PaymentMethodSetupInfo { @SerializedName(SERIALIZED_NAME_CARTES_BANCAIRES) private CartesBancairesInfo cartesBancaires; + public static final String SERIALIZED_NAME_CLEARPAY = "clearpay"; + @SerializedName(SERIALIZED_NAME_CLEARPAY) + private ClearpayInfo clearpay; + public static final String SERIALIZED_NAME_COUNTRIES = "countries"; @SerializedName(SERIALIZED_NAME_COUNTRIES) private List countries = null; @@ -180,6 +193,10 @@ public ShopperInteractionEnum read(final JsonReader jsonReader) throws IOExcepti @SerializedName(SERIALIZED_NAME_SWISH) private SwishInfo swish; + public static final String SERIALIZED_NAME_TWINT = "twint"; + @SerializedName(SERIALIZED_NAME_TWINT) + private TwintInfo twint; + /** * Payment method [variant](https://docs.adyen.com/development-resources/paymentmethodvariant#management-api). */ @@ -269,6 +286,10 @@ public enum TypeEnum { TRUSTLY("trustly"), + TWINT("twint"), + + TWINT_POS("twint_pos"), + VIPPS("vipps"), VISA("visa"), @@ -330,6 +351,28 @@ public TypeEnum read(final JsonReader jsonReader) throws IOException { public PaymentMethodSetupInfo() { } + public PaymentMethodSetupInfo afterpayTouch(AfterpayTouchInfo afterpayTouch) { + + this.afterpayTouch = afterpayTouch; + return this; + } + + /** + * Get afterpayTouch + * @return afterpayTouch + **/ + @ApiModelProperty(value = "") + + public AfterpayTouchInfo getAfterpayTouch() { + return afterpayTouch; + } + + + public void setAfterpayTouch(AfterpayTouchInfo afterpayTouch) { + this.afterpayTouch = afterpayTouch; + } + + public PaymentMethodSetupInfo applePay(ApplePayInfo applePay) { this.applePay = applePay; @@ -418,6 +461,28 @@ public void setCartesBancaires(CartesBancairesInfo cartesBancaires) { } + public PaymentMethodSetupInfo clearpay(ClearpayInfo clearpay) { + + this.clearpay = clearpay; + return this; + } + + /** + * Get clearpay + * @return clearpay + **/ + @ApiModelProperty(value = "") + + public ClearpayInfo getClearpay() { + return clearpay; + } + + + public void setClearpay(ClearpayInfo clearpay) { + this.clearpay = clearpay; + } + + public PaymentMethodSetupInfo countries(List countries) { this.countries = countries; @@ -728,6 +793,28 @@ public void setSwish(SwishInfo swish) { } + public PaymentMethodSetupInfo twint(TwintInfo twint) { + + this.twint = twint; + return this; + } + + /** + * Get twint + * @return twint + **/ + @ApiModelProperty(value = "") + + public TwintInfo getTwint() { + return twint; + } + + + public void setTwint(TwintInfo twint) { + this.twint = twint; + } + + public PaymentMethodSetupInfo type(TypeEnum type) { this.type = type; @@ -782,10 +869,12 @@ public boolean equals(Object o) { return false; } PaymentMethodSetupInfo paymentMethodSetupInfo = (PaymentMethodSetupInfo) o; - return Objects.equals(this.applePay, paymentMethodSetupInfo.applePay) && + return Objects.equals(this.afterpayTouch, paymentMethodSetupInfo.afterpayTouch) && + Objects.equals(this.applePay, paymentMethodSetupInfo.applePay) && Objects.equals(this.bcmc, paymentMethodSetupInfo.bcmc) && Objects.equals(this.businessLineId, paymentMethodSetupInfo.businessLineId) && Objects.equals(this.cartesBancaires, paymentMethodSetupInfo.cartesBancaires) && + Objects.equals(this.clearpay, paymentMethodSetupInfo.clearpay) && Objects.equals(this.countries, paymentMethodSetupInfo.countries) && Objects.equals(this.currencies, paymentMethodSetupInfo.currencies) && Objects.equals(this.customRoutingFlags, paymentMethodSetupInfo.customRoutingFlags) && @@ -799,23 +888,26 @@ 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.twint, paymentMethodSetupInfo.twint) && 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, vipps); + return Objects.hash(afterpayTouch, applePay, bcmc, businessLineId, cartesBancaires, clearpay, countries, currencies, customRoutingFlags, giroPay, googlePay, klarna, mealVoucherFR, paypal, reference, shopperInteraction, sofort, storeId, swish, twint, type, vipps); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PaymentMethodSetupInfo {\n"); + sb.append(" afterpayTouch: ").append(toIndentedString(afterpayTouch)).append("\n"); sb.append(" applePay: ").append(toIndentedString(applePay)).append("\n"); sb.append(" bcmc: ").append(toIndentedString(bcmc)).append("\n"); sb.append(" businessLineId: ").append(toIndentedString(businessLineId)).append("\n"); sb.append(" cartesBancaires: ").append(toIndentedString(cartesBancaires)).append("\n"); + sb.append(" clearpay: ").append(toIndentedString(clearpay)).append("\n"); sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); sb.append(" currencies: ").append(toIndentedString(currencies)).append("\n"); sb.append(" customRoutingFlags: ").append(toIndentedString(customRoutingFlags)).append("\n"); @@ -829,6 +921,7 @@ public String toString() { sb.append(" sofort: ").append(toIndentedString(sofort)).append("\n"); sb.append(" storeId: ").append(toIndentedString(storeId)).append("\n"); sb.append(" swish: ").append(toIndentedString(swish)).append("\n"); + sb.append(" twint: ").append(toIndentedString(twint)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" vipps: ").append(toIndentedString(vipps)).append("\n"); sb.append("}"); @@ -853,10 +946,12 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("afterpayTouch"); openapiFields.add("applePay"); openapiFields.add("bcmc"); openapiFields.add("businessLineId"); openapiFields.add("cartesBancaires"); + openapiFields.add("clearpay"); openapiFields.add("countries"); openapiFields.add("currencies"); openapiFields.add("customRoutingFlags"); @@ -870,12 +965,17 @@ private String toIndentedString(Object o) { openapiFields.add("sofort"); openapiFields.add("storeId"); openapiFields.add("swish"); + openapiFields.add("twint"); openapiFields.add("type"); openapiFields.add("vipps"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodSetupInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -896,9 +996,13 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentMethodSetupInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodSetupInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodSetupInfo` properties.", entry.getKey())); } } + // validate the optional field `afterpayTouch` + if (jsonObj.getAsJsonObject("afterpayTouch") != null) { + AfterpayTouchInfo.validateJsonObject(jsonObj.getAsJsonObject("afterpayTouch")); + } // validate the optional field `applePay` if (jsonObj.getAsJsonObject("applePay") != null) { ApplePayInfo.validateJsonObject(jsonObj.getAsJsonObject("applePay")); @@ -909,23 +1013,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field businessLineId if (jsonObj.get("businessLineId") != null && !jsonObj.get("businessLineId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("businessLineId").toString())); } // validate the optional field `cartesBancaires` if (jsonObj.getAsJsonObject("cartesBancaires") != null) { CartesBancairesInfo.validateJsonObject(jsonObj.getAsJsonObject("cartesBancaires")); } + // validate the optional field `clearpay` + if (jsonObj.getAsJsonObject("clearpay") != null) { + ClearpayInfo.validateJsonObject(jsonObj.getAsJsonObject("clearpay")); + } // ensure the json data is an array if (jsonObj.get("countries") != null && !jsonObj.get("countries").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `countries` to be an array in the JSON string but got `%s`", jsonObj.get("countries").toString())); + log.log(Level.WARNING, String.format("Expected the field `countries` to be an array in the JSON string but got `%s`", jsonObj.get("countries").toString())); } // ensure the json data is an array if (jsonObj.get("currencies") != null && !jsonObj.get("currencies").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `currencies` to be an array in the JSON string but got `%s`", jsonObj.get("currencies").toString())); + log.log(Level.WARNING, String.format("Expected the field `currencies` to be an array in the JSON string but got `%s`", jsonObj.get("currencies").toString())); } // ensure the json data is an array if (jsonObj.get("customRoutingFlags") != null && !jsonObj.get("customRoutingFlags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `customRoutingFlags` to be an array in the JSON string but got `%s`", jsonObj.get("customRoutingFlags").toString())); + log.log(Level.WARNING, String.format("Expected the field `customRoutingFlags` to be an array in the JSON string but got `%s`", jsonObj.get("customRoutingFlags").toString())); } // validate the optional field `giroPay` if (jsonObj.getAsJsonObject("giroPay") != null) { @@ -949,7 +1057,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -964,12 +1072,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field storeId if (jsonObj.get("storeId") != null && !jsonObj.get("storeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); } // validate the optional field `swish` if (jsonObj.getAsJsonObject("swish") != null) { SwishInfo.validateJsonObject(jsonObj.getAsJsonObject("swish")); } + // validate the optional field `twint` + if (jsonObj.getAsJsonObject("twint") != null) { + TwintInfo.validateJsonObject(jsonObj.getAsJsonObject("twint")); + } // 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/management/PaymentMethodWrapper.java b/src/main/java/com/adyen/model/management/PaymentMethodWrapper.java new file mode 100644 index 000000000..3ff41d167 --- /dev/null +++ b/src/main/java/com/adyen/model/management/PaymentMethodWrapper.java @@ -0,0 +1,215 @@ +/* + * 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.adyen.model.management.PaymentMethod; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.management.JSON; + +/** + * PaymentMethodWrapper + */ + +public class PaymentMethodWrapper { + public static final String SERIALIZED_NAME_PAYMENT_METHOD = "PaymentMethod"; + @SerializedName(SERIALIZED_NAME_PAYMENT_METHOD) + private PaymentMethod paymentMethod; + + public PaymentMethodWrapper() { + } + + public PaymentMethodWrapper paymentMethod(PaymentMethod paymentMethod) { + + this.paymentMethod = paymentMethod; + return this; + } + + /** + * Get paymentMethod + * @return paymentMethod + **/ + @ApiModelProperty(value = "") + + public PaymentMethod getPaymentMethod() { + return paymentMethod; + } + + + public void setPaymentMethod(PaymentMethod paymentMethod) { + this.paymentMethod = paymentMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentMethodWrapper paymentMethodWrapper = (PaymentMethodWrapper) o; + return Objects.equals(this.paymentMethod, paymentMethodWrapper.paymentMethod); + } + + @Override + public int hashCode() { + return Objects.hash(paymentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentMethodWrapper {\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).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("PaymentMethod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentMethodWrapper.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentMethodWrapper + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaymentMethodWrapper.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentMethodWrapper is not found in the empty JSON string", PaymentMethodWrapper.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaymentMethodWrapper.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentMethodWrapper` properties.", entry.getKey())); + } + } + // validate the optional field `PaymentMethod` + if (jsonObj.getAsJsonObject("PaymentMethod") != null) { + PaymentMethod.validateJsonObject(jsonObj.getAsJsonObject("PaymentMethod")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentMethodWrapper.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentMethodWrapper' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentMethodWrapper.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentMethodWrapper value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaymentMethodWrapper read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentMethodWrapper given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentMethodWrapper + * @throws IOException if the JSON string is invalid with respect to PaymentMethodWrapper + */ + public static PaymentMethodWrapper fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentMethodWrapper.class); + } + + /** + * Convert an instance of PaymentMethodWrapper to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/management/PayoutSettings.java b/src/main/java/com/adyen/model/management/PayoutSettings.java index af845d00d..e0d05cb5d 100644 --- a/src/main/java/com/adyen/model/management/PayoutSettings.java +++ b/src/main/java/com/adyen/model/management/PayoutSettings.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -403,6 +405,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("id"); openapiRequiredFields.add("transferInstrumentId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayoutSettings.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -423,7 +429,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayoutSettings.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayoutSettings` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayoutSettings` properties.", entry.getKey())); } } @@ -435,11 +441,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field enabledFromDate if (jsonObj.get("enabledFromDate") != null && !jsonObj.get("enabledFromDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enabledFromDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enabledFromDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enabledFromDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enabledFromDate").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the field priority can be parsed to an enum value if (jsonObj.get("priority") != null) { @@ -450,7 +456,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); } // 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/management/PayoutSettingsRequest.java b/src/main/java/com/adyen/model/management/PayoutSettingsRequest.java index bc262b61f..72a8c2ffe 100644 --- a/src/main/java/com/adyen/model/management/PayoutSettingsRequest.java +++ b/src/main/java/com/adyen/model/management/PayoutSettingsRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("transferInstrumentId"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayoutSettingsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,7 +212,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayoutSettingsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayoutSettingsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayoutSettingsRequest` properties.", entry.getKey())); } } @@ -218,11 +224,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field enabledFromDate if (jsonObj.get("enabledFromDate") != null && !jsonObj.get("enabledFromDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enabledFromDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enabledFromDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enabledFromDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enabledFromDate").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())); + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); } } diff --git a/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java b/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java index 03bd165e0..c9cded4b5 100644 --- a/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java +++ b/src/main/java/com/adyen/model/management/PayoutSettingsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayoutSettingsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayoutSettingsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayoutSettingsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayoutSettingsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/Profile.java b/src/main/java/com/adyen/model/management/Profile.java index e6e7e453b..27c44b388 100644 --- a/src/main/java/com/adyen/model/management/Profile.java +++ b/src/main/java/com/adyen/model/management/Profile.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -625,6 +627,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("ssid"); openapiRequiredFields.add("wsec"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Profile.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -645,7 +651,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Profile.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Profile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Profile` properties.", entry.getKey())); } } @@ -657,15 +663,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field authType if (jsonObj.get("authType") != null && !jsonObj.get("authType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authType").toString())); + log.log(Level.WARNING, String.format("Expected the field `authType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authType").toString())); } // validate the optional field bssType if (jsonObj.get("bssType") != null && !jsonObj.get("bssType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bssType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bssType").toString())); + log.log(Level.WARNING, String.format("Expected the field `bssType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bssType").toString())); } // validate the optional field eap if (jsonObj.get("eap") != null && !jsonObj.get("eap").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eap").toString())); + log.log(Level.WARNING, String.format("Expected the field `eap` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eap").toString())); } // validate the optional field `eapCaCert` if (jsonObj.getAsJsonObject("eapCaCert") != null) { @@ -681,11 +687,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field eapClientPwd if (jsonObj.get("eapClientPwd") != null && !jsonObj.get("eapClientPwd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eapClientPwd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eapClientPwd").toString())); + log.log(Level.WARNING, String.format("Expected the field `eapClientPwd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eapClientPwd").toString())); } // validate the optional field eapIdentity if (jsonObj.get("eapIdentity") != null && !jsonObj.get("eapIdentity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eapIdentity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eapIdentity").toString())); + log.log(Level.WARNING, String.format("Expected the field `eapIdentity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eapIdentity").toString())); } // validate the optional field `eapIntermediateCert` if (jsonObj.getAsJsonObject("eapIntermediateCert") != null) { @@ -693,23 +699,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field eapPwd if (jsonObj.get("eapPwd") != null && !jsonObj.get("eapPwd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eapPwd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eapPwd").toString())); + log.log(Level.WARNING, String.format("Expected the field `eapPwd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eapPwd").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field psk if (jsonObj.get("psk") != null && !jsonObj.get("psk").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `psk` to be a primitive type in the JSON string but got `%s`", jsonObj.get("psk").toString())); + log.log(Level.WARNING, String.format("Expected the field `psk` to be a primitive type in the JSON string but got `%s`", jsonObj.get("psk").toString())); } // validate the optional field ssid if (jsonObj.get("ssid") != null && !jsonObj.get("ssid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ssid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ssid").toString())); + log.log(Level.WARNING, String.format("Expected the field `ssid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ssid").toString())); } // validate the optional field wsec if (jsonObj.get("wsec") != null && !jsonObj.get("wsec").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `wsec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wsec").toString())); + log.log(Level.WARNING, String.format("Expected the field `wsec` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wsec").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ReceiptOptions.java b/src/main/java/com/adyen/model/management/ReceiptOptions.java index cbf6b422b..8c9ac461a 100644 --- a/src/main/java/com/adyen/model/management/ReceiptOptions.java +++ b/src/main/java/com/adyen/model/management/ReceiptOptions.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ReceiptOptions.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ReceiptOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReceiptOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ReceiptOptions` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 qrCodeData if (jsonObj.get("qrCodeData") != null && !jsonObj.get("qrCodeData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `qrCodeData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qrCodeData").toString())); + log.log(Level.WARNING, String.format("Expected the field `qrCodeData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qrCodeData").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ReceiptPrinting.java b/src/main/java/com/adyen/model/management/ReceiptPrinting.java index 3e81a4312..260754c45 100644 --- a/src/main/java/com/adyen/model/management/ReceiptPrinting.java +++ b/src/main/java/com/adyen/model/management/ReceiptPrinting.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -562,6 +564,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ReceiptPrinting.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -582,7 +588,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ReceiptPrinting.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReceiptPrinting` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ReceiptPrinting` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/management/ReleaseUpdateDetails.java b/src/main/java/com/adyen/model/management/ReleaseUpdateDetails.java index 1377823ca..7849f97ac 100644 --- a/src/main/java/com/adyen/model/management/ReleaseUpdateDetails.java +++ b/src/main/java/com/adyen/model/management/ReleaseUpdateDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ReleaseUpdateDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,7 +227,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ReleaseUpdateDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReleaseUpdateDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ReleaseUpdateDetails` properties.", entry.getKey())); } } // ensure the field type can be parsed to an enum value diff --git a/src/main/java/com/adyen/model/management/RequestActivationResponse.java b/src/main/java/com/adyen/model/management/RequestActivationResponse.java index 7552531c1..c4e65adac 100644 --- a/src/main/java/com/adyen/model/management/RequestActivationResponse.java +++ b/src/main/java/com/adyen/model/management/RequestActivationResponse.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RequestActivationResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RequestActivationResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RequestActivationResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RequestActivationResponse` properties.", entry.getKey())); } } // validate the optional field companyId if (jsonObj.get("companyId") != null && !jsonObj.get("companyId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").toString())); + log.log(Level.WARNING, String.format("Expected the field `companyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("companyId").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())); + log.log(Level.WARNING, 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/RestServiceError.java b/src/main/java/com/adyen/model/management/RestServiceError.java index 8d0460b78..6e30433ec 100644 --- a/src/main/java/com/adyen/model/management/RestServiceError.java +++ b/src/main/java/com/adyen/model/management/RestServiceError.java @@ -14,7 +14,7 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.management.InvalidField; +import com.adyen.model.management.InvalidFieldWrapper; import com.adyen.model.management.JSONObject; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -66,7 +68,7 @@ public class RestServiceError { public static final String SERIALIZED_NAME_INVALID_FIELDS = "invalidFields"; @SerializedName(SERIALIZED_NAME_INVALID_FIELDS) - private List invalidFields = null; + private List invalidFields = null; public static final String SERIALIZED_NAME_REQUEST_ID = "requestId"; @SerializedName(SERIALIZED_NAME_REQUEST_ID) @@ -157,13 +159,13 @@ public void setInstance(String instance) { } - public RestServiceError invalidFields(List invalidFields) { + public RestServiceError invalidFields(List invalidFields) { this.invalidFields = invalidFields; return this; } - public RestServiceError addInvalidFieldsItem(InvalidField invalidFieldsItem) { + public RestServiceError addInvalidFieldsItem(InvalidFieldWrapper invalidFieldsItem) { if (this.invalidFields == null) { this.invalidFields = new ArrayList<>(); } @@ -177,12 +179,12 @@ public RestServiceError addInvalidFieldsItem(InvalidField invalidFieldsItem) { **/ @ApiModelProperty(value = "Detailed explanation of each validation error, when applicable.") - public List getInvalidFields() { + public List getInvalidFields() { return invalidFields; } - public void setInvalidFields(List invalidFields) { + public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; } @@ -376,6 +378,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("title"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RestServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -396,7 +402,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RestServiceError` properties.", entry.getKey())); } } @@ -408,15 +414,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); } // validate the optional field errorCode if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field instance if (jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); } JsonArray jsonArrayinvalidFields = jsonObj.getAsJsonArray("invalidFields"); if (jsonArrayinvalidFields != null) { @@ -427,12 +433,12 @@ 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()); + InvalidFieldWrapper.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())); + log.log(Level.WARNING, String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); } // validate the optional field `response` if (jsonObj.getAsJsonObject("response") != null) { @@ -440,11 +446,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } // validate the optional field type if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequest.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequest.java index 6ad1d314f..5e7074584 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequest.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -225,6 +227,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ScheduleTerminalActionsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -245,7 +251,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ScheduleTerminalActionsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScheduleTerminalActionsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ScheduleTerminalActionsRequest` properties.", entry.getKey())); } } // validate the optional field `actionDetails` @@ -254,15 +260,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field scheduledAt if (jsonObj.get("scheduledAt") != null && !jsonObj.get("scheduledAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scheduledAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheduledAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `scheduledAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheduledAt").toString())); } // validate the optional field storeId if (jsonObj.get("storeId") != null && !jsonObj.get("storeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); } // ensure the json data is an array if (jsonObj.get("terminalIds") != null && !jsonObj.get("terminalIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalIds` to be an array in the JSON string but got `%s`", jsonObj.get("terminalIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalIds` to be an array in the JSON string but got `%s`", jsonObj.get("terminalIds").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java index 2d3777223..1d0e65b11 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsRequestActionDetails.java @@ -378,6 +378,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with InstallAndroidAppDetails try { + Logger.getLogger(InstallAndroidAppDetails.class.getName()).setLevel(Level.OFF); InstallAndroidAppDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -386,6 +387,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with InstallAndroidCertificateDetails try { + Logger.getLogger(InstallAndroidCertificateDetails.class.getName()).setLevel(Level.OFF); InstallAndroidCertificateDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -394,6 +396,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with ReleaseUpdateDetails try { + Logger.getLogger(ReleaseUpdateDetails.class.getName()).setLevel(Level.OFF); ReleaseUpdateDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -402,6 +405,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UninstallAndroidAppDetails try { + Logger.getLogger(UninstallAndroidAppDetails.class.getName()).setLevel(Level.OFF); UninstallAndroidAppDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -410,6 +414,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UninstallAndroidCertificateDetails try { + Logger.getLogger(UninstallAndroidCertificateDetails.class.getName()).setLevel(Level.OFF); UninstallAndroidCertificateDetails.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java index 0026e62d2..f0018b30f 100644 --- a/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java +++ b/src/main/java/com/adyen/model/management/ScheduleTerminalActionsResponse.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -365,6 +367,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ScheduleTerminalActionsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -385,7 +391,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ScheduleTerminalActionsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScheduleTerminalActionsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ScheduleTerminalActionsResponse` properties.", entry.getKey())); } } // validate the optional field `actionDetails` @@ -406,15 +412,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field scheduledAt if (jsonObj.get("scheduledAt") != null && !jsonObj.get("scheduledAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scheduledAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheduledAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `scheduledAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scheduledAt").toString())); } // validate the optional field storeId if (jsonObj.get("storeId") != null && !jsonObj.get("storeId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeId").toString())); } // ensure the json data is an array if (jsonObj.get("terminalIds") != null && !jsonObj.get("terminalIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalIds` to be an array in the JSON string but got `%s`", jsonObj.get("terminalIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalIds` to be an array in the JSON string but got `%s`", jsonObj.get("terminalIds").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Settings.java b/src/main/java/com/adyen/model/management/Settings.java index 3a2f390ee..6c9c375fc 100644 --- a/src/main/java/com/adyen/model/management/Settings.java +++ b/src/main/java/com/adyen/model/management/Settings.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Settings.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,12 +211,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Settings.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Settings` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Settings` properties.", entry.getKey())); } } // validate the optional field band if (jsonObj.get("band") != null && !jsonObj.get("band").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `band` to be a primitive type in the JSON string but got `%s`", jsonObj.get("band").toString())); + log.log(Level.WARNING, String.format("Expected the field `band` to be a primitive type in the JSON string but got `%s`", jsonObj.get("band").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ShippingLocation.java b/src/main/java/com/adyen/model/management/ShippingLocation.java index 1fbaa469e..52a6320c2 100644 --- a/src/main/java/com/adyen/model/management/ShippingLocation.java +++ b/src/main/java/com/adyen/model/management/ShippingLocation.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -216,6 +218,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ShippingLocation.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -236,7 +242,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ShippingLocation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShippingLocation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ShippingLocation` properties.", entry.getKey())); } } // validate the optional field `address` @@ -249,11 +255,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java b/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java index 24392f444..71c750032 100644 --- a/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java +++ b/src/main/java/com/adyen/model/management/ShippingLocationsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ShippingLocationsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ShippingLocationsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShippingLocationsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ShippingLocationsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/ShopperStatement.java b/src/main/java/com/adyen/model/management/ShopperStatement.java deleted file mode 100644 index aedf409bc..000000000 --- a/src/main/java/com/adyen/model/management/ShopperStatement.java +++ /dev/null @@ -1,293 +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.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; - -/** - * ShopperStatement - */ - -public class ShopperStatement { - public static final String SERIALIZED_NAME_DOING_BUSINESS_AS_NAME = "doingBusinessAsName"; - @SerializedName(SERIALIZED_NAME_DOING_BUSINESS_AS_NAME) - private String doingBusinessAsName; - - /** - * The type of shopperstatement you want to use: fixed, append or dynamic - */ - @JsonAdapter(TypeEnum.Adapter.class) - public enum TypeEnum { - APPEND("append"), - - DYNAMIC("dynamic"), - - FIXED("fixed"); - - 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.DYNAMIC; - - public ShopperStatement() { - } - - public ShopperStatement doingBusinessAsName(String doingBusinessAsName) { - - this.doingBusinessAsName = doingBusinessAsName; - return this; - } - - /** - * The name you want to be shown on the shopper's bank or credit card statement. Can't be all numbers. If a shopper statement is present, this field is required. - * @return doingBusinessAsName - **/ - @ApiModelProperty(value = "The name you want to be shown on the shopper's bank or credit card statement. Can't be all numbers. If a shopper statement is present, this field is required.") - - public String getDoingBusinessAsName() { - return doingBusinessAsName; - } - - - public void setDoingBusinessAsName(String doingBusinessAsName) { - this.doingBusinessAsName = doingBusinessAsName; - } - - - public ShopperStatement type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * The type of shopperstatement you want to use: fixed, append or dynamic - * @return type - **/ - @ApiModelProperty(value = "The type of shopperstatement you want to use: fixed, append or dynamic") - - 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; - } - ShopperStatement shopperStatement = (ShopperStatement) o; - return Objects.equals(this.doingBusinessAsName, shopperStatement.doingBusinessAsName) && - Objects.equals(this.type, shopperStatement.type); - } - - @Override - public int hashCode() { - return Objects.hash(doingBusinessAsName, type); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ShopperStatement {\n"); - sb.append(" doingBusinessAsName: ").append(toIndentedString(doingBusinessAsName)).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("doingBusinessAsName"); - 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 ShopperStatement - */ - public static void validateJsonObject(JsonObject jsonObj) throws IOException { - if (jsonObj == null) { - if (ShopperStatement.openapiRequiredFields.isEmpty()) { - return; - } else { // has required fields - throw new IllegalArgumentException(String.format("The required field(s) %s in ShopperStatement is not found in the empty JSON string", ShopperStatement.openapiRequiredFields.toString())); - } - } - - Set> entries = jsonObj.entrySet(); - // check to see if the JSON string contains additional fields - for (Entry entry : entries) { - if (!ShopperStatement.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShopperStatement` properties. JSON: %s", entry.getKey(), jsonObj.toString())); - } - } - // validate the optional field doingBusinessAsName - if (jsonObj.get("doingBusinessAsName") != null && !jsonObj.get("doingBusinessAsName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `doingBusinessAsName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("doingBusinessAsName").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 (!ShopperStatement.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'ShopperStatement' and its subtypes - } - final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(ShopperStatement.class)); - - return (TypeAdapter) new TypeAdapter() { - @Override - public void write(JsonWriter out, ShopperStatement value) throws IOException { - JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); - elementAdapter.write(out, obj); - } - - @Override - public ShopperStatement read(JsonReader in) throws IOException { - JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); - validateJsonObject(jsonObj); - return thisAdapter.fromJsonTree(jsonObj); - } - - }.nullSafe(); - } - } - - /** - * Create an instance of ShopperStatement given an JSON string - * - * @param jsonString JSON string - * @return An instance of ShopperStatement - * @throws IOException if the JSON string is invalid with respect to ShopperStatement - */ - public static ShopperStatement fromJson(String jsonString) throws IOException { - return JSON.getGson().fromJson(jsonString, ShopperStatement.class); - } - - /** - * Convert an instance of ShopperStatement to an JSON string - * - * @return JSON string - */ - public String toJson() { - return JSON.getGson().toJson(this); - } -} - diff --git a/src/main/java/com/adyen/model/management/Signature.java b/src/main/java/com/adyen/model/management/Signature.java index 345869252..93d9283aa 100644 --- a/src/main/java/com/adyen/model/management/Signature.java +++ b/src/main/java/com/adyen/model/management/Signature.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Signature.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,16 +240,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Signature.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Signature` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Signature` properties.", entry.getKey())); } } // validate the optional field deviceName if (jsonObj.get("deviceName") != null && !jsonObj.get("deviceName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceName").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceName").toString())); } // validate the optional field deviceSlogan if (jsonObj.get("deviceSlogan") != null && !jsonObj.get("deviceSlogan").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceSlogan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceSlogan").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceSlogan` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceSlogan").toString())); } } diff --git a/src/main/java/com/adyen/model/management/SofortInfo.java b/src/main/java/com/adyen/model/management/SofortInfo.java index 790e6efa1..35c593bfc 100644 --- a/src/main/java/com/adyen/model/management/SofortInfo.java +++ b/src/main/java/com/adyen/model/management/SofortInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currencyCode"); openapiRequiredFields.add("logo"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SofortInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SofortInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SofortInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SofortInfo` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Standalone.java b/src/main/java/com/adyen/model/management/Standalone.java index f03a80db2..1cb536cd8 100644 --- a/src/main/java/com/adyen/model/management/Standalone.java +++ b/src/main/java/com/adyen/model/management/Standalone.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Standalone.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,12 +182,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Standalone.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Standalone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Standalone` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currencyCode").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Store.java b/src/main/java/com/adyen/model/management/Store.java index f32736052..e89d94d99 100644 --- a/src/main/java/com/adyen/model/management/Store.java +++ b/src/main/java/com/adyen/model/management/Store.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -508,6 +510,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Store.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -528,7 +534,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Store` properties.", entry.getKey())); } } // validate the optional field `_links` @@ -541,35 +547,35 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("businessLineIds") != null && !jsonObj.get("businessLineIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").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())); + log.log(Level.WARNING, 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 externalReferenceId if (jsonObj.get("externalReferenceId") != null && !jsonObj.get("externalReferenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").toString())); + log.log(Level.WARNING, String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `merchantId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantId").toString())); } // validate the optional field phoneNumber if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field `splitConfiguration` if (jsonObj.getAsJsonObject("splitConfiguration") != null) { diff --git a/src/main/java/com/adyen/model/management/StoreCreationRequest.java b/src/main/java/com/adyen/model/management/StoreCreationRequest.java index 614e210d9..dee01f2b8 100644 --- a/src/main/java/com/adyen/model/management/StoreCreationRequest.java +++ b/src/main/java/com/adyen/model/management/StoreCreationRequest.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -124,10 +126,10 @@ public StoreCreationRequest addBusinessLineIdsItem(String businessLineIdsItem) { } /** - * The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. * @return businessLineIds **/ - @ApiModelProperty(value = "The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account.") + @ApiModelProperty(value = "The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account.") public List getBusinessLineIds() { return businessLineIds; @@ -212,10 +214,10 @@ public StoreCreationRequest reference(String reference) { } /** - * Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). + * Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). * @return reference **/ - @ApiModelProperty(value = "Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_).") + @ApiModelProperty(value = "Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id).") public String getReference() { return reference; @@ -346,6 +348,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("phoneNumber"); openapiRequiredFields.add("shopperStatement"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreCreationRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -366,7 +372,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreCreationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreCreationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreCreationRequest` properties.", entry.getKey())); } } @@ -382,27 +388,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("businessLineIds") != null && !jsonObj.get("businessLineIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").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())); + log.log(Level.WARNING, 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 externalReferenceId if (jsonObj.get("externalReferenceId") != null && !jsonObj.get("externalReferenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").toString())); + log.log(Level.WARNING, String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").toString())); } // validate the optional field phoneNumber if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field `splitConfiguration` if (jsonObj.getAsJsonObject("splitConfiguration") != null) { diff --git a/src/main/java/com/adyen/model/management/StoreCreationWithMerchantCodeRequest.java b/src/main/java/com/adyen/model/management/StoreCreationWithMerchantCodeRequest.java index 697d12e79..3c4491cde 100644 --- a/src/main/java/com/adyen/model/management/StoreCreationWithMerchantCodeRequest.java +++ b/src/main/java/com/adyen/model/management/StoreCreationWithMerchantCodeRequest.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -128,10 +130,10 @@ public StoreCreationWithMerchantCodeRequest addBusinessLineIdsItem(String busine } /** - * The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. + * The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account. * @return businessLineIds **/ - @ApiModelProperty(value = "The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/businesslines__resParam_id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account.") + @ApiModelProperty(value = "The unique identifiers of the [business lines](https://docs.adyen.com/api-explorer/legalentity/latest/post/businessLines#responses-200-id) that the store is associated with. If not specified, the business line of the merchant account is used. Required when there are multiple business lines under the merchant account.") public List getBusinessLineIds() { return businessLineIds; @@ -238,10 +240,10 @@ public StoreCreationWithMerchantCodeRequest reference(String reference) { } /** - * Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). + * Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id). * @return reference **/ - @ApiModelProperty(value = "Your reference to recognize the store by. Also known as the store code. Allowed characters: Lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_).") + @ApiModelProperty(value = "Your reference to recognize the store by. Also known as the store code. Allowed characters: lowercase and uppercase letters without diacritics, numbers 0 through 9, hyphen (-), and underscore (_). If you do not provide a reference in your POST request, it is populated with the Adyen-generated [id](https://docs.adyen.com/api-explorer/Management/latest/post/stores#responses-200-id).") public String getReference() { return reference; @@ -376,6 +378,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("phoneNumber"); openapiRequiredFields.add("shopperStatement"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreCreationWithMerchantCodeRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -396,7 +402,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreCreationWithMerchantCodeRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreCreationWithMerchantCodeRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreCreationWithMerchantCodeRequest` properties.", entry.getKey())); } } @@ -412,31 +418,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("businessLineIds") != null && !jsonObj.get("businessLineIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").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())); + log.log(Level.WARNING, 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 externalReferenceId if (jsonObj.get("externalReferenceId") != null && !jsonObj.get("externalReferenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").toString())); + log.log(Level.WARNING, String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").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())); + log.log(Level.WARNING, String.format("Expected the field `merchantId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantId").toString())); } // validate the optional field phoneNumber if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field `splitConfiguration` if (jsonObj.getAsJsonObject("splitConfiguration") != null) { diff --git a/src/main/java/com/adyen/model/management/StoreLocation.java b/src/main/java/com/adyen/model/management/StoreLocation.java index 690e7e5b9..efa1fc2cf 100644 --- a/src/main/java/com/adyen/model/management/StoreLocation.java +++ b/src/main/java/com/adyen/model/management/StoreLocation.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -302,6 +304,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("country"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreLocation.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -322,7 +328,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreLocation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreLocation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreLocation` properties.", entry.getKey())); } } @@ -334,31 +340,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 line1 if (jsonObj.get("line1") != null && !jsonObj.get("line1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); + log.log(Level.WARNING, String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); } // validate the optional field line2 if (jsonObj.get("line2") != null && !jsonObj.get("line2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); + log.log(Level.WARNING, String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); } // validate the optional field line3 if (jsonObj.get("line3") != null && !jsonObj.get("line3").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line3").toString())); + log.log(Level.WARNING, String.format("Expected the field `line3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line3").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateOrProvince").toString())); } } diff --git a/src/main/java/com/adyen/model/management/StoreSplitConfiguration.java b/src/main/java/com/adyen/model/management/StoreSplitConfiguration.java index 1979f91ce..b81f6a7a0 100644 --- a/src/main/java/com/adyen/model/management/StoreSplitConfiguration.java +++ b/src/main/java/com/adyen/model/management/StoreSplitConfiguration.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreSplitConfiguration.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreSplitConfiguration.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreSplitConfiguration` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreSplitConfiguration` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field splitConfigurationId if (jsonObj.get("splitConfigurationId") != null && !jsonObj.get("splitConfigurationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `splitConfigurationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("splitConfigurationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `splitConfigurationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("splitConfigurationId").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Surcharge.java b/src/main/java/com/adyen/model/management/Surcharge.java index 5b5754b1d..c2a0742c0 100644 --- a/src/main/java/com/adyen/model/management/Surcharge.java +++ b/src/main/java/com/adyen/model/management/Surcharge.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Surcharge.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Surcharge.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Surcharge` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Surcharge` properties.", entry.getKey())); } } JsonArray jsonArrayconfigurations = jsonObj.getAsJsonArray("configurations"); diff --git a/src/main/java/com/adyen/model/management/SwishInfo.java b/src/main/java/com/adyen/model/management/SwishInfo.java index f7739f09f..b442b0915 100644 --- a/src/main/java/com/adyen/model/management/SwishInfo.java +++ b/src/main/java/com/adyen/model/management/SwishInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SwishInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SwishInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SwishInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SwishInfo` properties.", entry.getKey())); } } // validate the optional field swishNumber if (jsonObj.get("swishNumber") != null && !jsonObj.get("swishNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `swishNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("swishNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `swishNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("swishNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Terminal.java b/src/main/java/com/adyen/model/management/Terminal.java index 176c18c42..544914232 100644 --- a/src/main/java/com/adyen/model/management/Terminal.java +++ b/src/main/java/com/adyen/model/management/Terminal.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -50,10 +52,12 @@ public class Terminal { public static final String SERIALIZED_NAME_ASSIGNED = "assigned"; + @Deprecated @SerializedName(SERIALIZED_NAME_ASSIGNED) private Boolean assigned; public static final String SERIALIZED_NAME_BLUETOOTH_IP = "bluetoothIp"; + @Deprecated @SerializedName(SERIALIZED_NAME_BLUETOOTH_IP) private String bluetoothIp; @@ -62,26 +66,32 @@ public class Terminal { private String bluetoothMac; public static final String SERIALIZED_NAME_CITY = "city"; + @Deprecated @SerializedName(SERIALIZED_NAME_CITY) private String city; public static final String SERIALIZED_NAME_COMPANY_ACCOUNT = "companyAccount"; + @Deprecated @SerializedName(SERIALIZED_NAME_COMPANY_ACCOUNT) private String companyAccount; public static final String SERIALIZED_NAME_COUNTRY_CODE = "countryCode"; + @Deprecated @SerializedName(SERIALIZED_NAME_COUNTRY_CODE) private String countryCode; public static final String SERIALIZED_NAME_DEVICE_MODEL = "deviceModel"; + @Deprecated @SerializedName(SERIALIZED_NAME_DEVICE_MODEL) private String deviceModel; public static final String SERIALIZED_NAME_ETHERNET_IP = "ethernetIp"; + @Deprecated @SerializedName(SERIALIZED_NAME_ETHERNET_IP) private String ethernetIp; public static final String SERIALIZED_NAME_ETHERNET_MAC = "ethernetMac"; + @Deprecated @SerializedName(SERIALIZED_NAME_ETHERNET_MAC) private String ethernetMac; @@ -90,6 +100,7 @@ public class Terminal { private String firmwareVersion; public static final String SERIALIZED_NAME_ICCID = "iccid"; + @Deprecated @SerializedName(SERIALIZED_NAME_ICCID) private String iccid; @@ -98,14 +109,17 @@ public class Terminal { private String id; public static final String SERIALIZED_NAME_LAST_ACTIVITY_DATE_TIME = "lastActivityDateTime"; + @Deprecated @SerializedName(SERIALIZED_NAME_LAST_ACTIVITY_DATE_TIME) private OffsetDateTime lastActivityDateTime; public static final String SERIALIZED_NAME_LAST_TRANSACTION_DATE_TIME = "lastTransactionDateTime"; + @Deprecated @SerializedName(SERIALIZED_NAME_LAST_TRANSACTION_DATE_TIME) private OffsetDateTime lastTransactionDateTime; public static final String SERIALIZED_NAME_LINK_NEGOTIATION = "linkNegotiation"; + @Deprecated @SerializedName(SERIALIZED_NAME_LINK_NEGOTIATION) private String linkNegotiation; @@ -114,32 +128,39 @@ public class Terminal { private String serialNumber; public static final String SERIALIZED_NAME_SIM_STATUS = "simStatus"; + @Deprecated @SerializedName(SERIALIZED_NAME_SIM_STATUS) private String simStatus; public static final String SERIALIZED_NAME_STATUS = "status"; + @Deprecated @SerializedName(SERIALIZED_NAME_STATUS) private String status; public static final String SERIALIZED_NAME_STORE_STATUS = "storeStatus"; + @Deprecated @SerializedName(SERIALIZED_NAME_STORE_STATUS) private String storeStatus; public static final String SERIALIZED_NAME_WIFI_IP = "wifiIp"; + @Deprecated @SerializedName(SERIALIZED_NAME_WIFI_IP) private String wifiIp; public static final String SERIALIZED_NAME_WIFI_MAC = "wifiMac"; + @Deprecated @SerializedName(SERIALIZED_NAME_WIFI_MAC) private String wifiMac; public static final String SERIALIZED_NAME_WIFI_SSID = "wifiSsid"; + @Deprecated @SerializedName(SERIALIZED_NAME_WIFI_SSID) private String wifiSsid; public Terminal() { } + @Deprecated public Terminal assigned(Boolean assigned) { this.assigned = assigned; @@ -149,7 +170,9 @@ public Terminal assigned(Boolean assigned) { /** * The [assignment status](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api) of the terminal. If true, the terminal is assigned. If false, the terminal is in inventory and can't be boarded. * @return assigned + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The [assignment status](https://docs.adyen.com/point-of-sale/automating-terminal-management/assign-terminals-api) of the terminal. If true, the terminal is assigned. If false, the terminal is in inventory and can't be boarded.") public Boolean getAssigned() { @@ -157,11 +180,13 @@ public Boolean getAssigned() { } + @Deprecated public void setAssigned(Boolean assigned) { this.assigned = assigned; } + @Deprecated public Terminal bluetoothIp(String bluetoothIp) { this.bluetoothIp = bluetoothIp; @@ -171,7 +196,9 @@ public Terminal bluetoothIp(String bluetoothIp) { /** * The Bluetooth IP address of the terminal. * @return bluetoothIp + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The Bluetooth IP address of the terminal.") public String getBluetoothIp() { @@ -179,6 +206,7 @@ public String getBluetoothIp() { } + @Deprecated public void setBluetoothIp(String bluetoothIp) { this.bluetoothIp = bluetoothIp; } @@ -206,6 +234,7 @@ public void setBluetoothMac(String bluetoothMac) { } + @Deprecated public Terminal city(String city) { this.city = city; @@ -215,7 +244,9 @@ public Terminal city(String city) { /** * The city where the terminal is located. * @return city + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The city where the terminal is located.") public String getCity() { @@ -223,11 +254,13 @@ public String getCity() { } + @Deprecated public void setCity(String city) { this.city = city; } + @Deprecated public Terminal companyAccount(String companyAccount) { this.companyAccount = companyAccount; @@ -237,7 +270,9 @@ public Terminal companyAccount(String 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 + * @deprecated **/ + @Deprecated @ApiModelProperty(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() { @@ -245,11 +280,13 @@ public String getCompanyAccount() { } + @Deprecated public void setCompanyAccount(String companyAccount) { this.companyAccount = companyAccount; } + @Deprecated public Terminal countryCode(String countryCode) { this.countryCode = countryCode; @@ -259,7 +296,9 @@ public Terminal countryCode(String countryCode) { /** * The country code of the country where the terminal is located. * @return countryCode + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The country code of the country where the terminal is located.") public String getCountryCode() { @@ -267,11 +306,13 @@ public String getCountryCode() { } + @Deprecated public void setCountryCode(String countryCode) { this.countryCode = countryCode; } + @Deprecated public Terminal deviceModel(String deviceModel) { this.deviceModel = deviceModel; @@ -281,7 +322,9 @@ public Terminal deviceModel(String deviceModel) { /** * The model name of the terminal. * @return deviceModel + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The model name of the terminal.") public String getDeviceModel() { @@ -289,11 +332,13 @@ public String getDeviceModel() { } + @Deprecated public void setDeviceModel(String deviceModel) { this.deviceModel = deviceModel; } + @Deprecated public Terminal ethernetIp(String ethernetIp) { this.ethernetIp = ethernetIp; @@ -303,7 +348,9 @@ public Terminal ethernetIp(String ethernetIp) { /** * The ethernet IP address of the terminal. * @return ethernetIp + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The ethernet IP address of the terminal.") public String getEthernetIp() { @@ -311,11 +358,13 @@ public String getEthernetIp() { } + @Deprecated public void setEthernetIp(String ethernetIp) { this.ethernetIp = ethernetIp; } + @Deprecated public Terminal ethernetMac(String ethernetMac) { this.ethernetMac = ethernetMac; @@ -325,7 +374,9 @@ public Terminal ethernetMac(String ethernetMac) { /** * The ethernet MAC address of the terminal. * @return ethernetMac + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The ethernet MAC address of the terminal.") public String getEthernetMac() { @@ -333,6 +384,7 @@ public String getEthernetMac() { } + @Deprecated public void setEthernetMac(String ethernetMac) { this.ethernetMac = ethernetMac; } @@ -360,6 +412,7 @@ public void setFirmwareVersion(String firmwareVersion) { } + @Deprecated public Terminal iccid(String iccid) { this.iccid = iccid; @@ -369,7 +422,9 @@ public Terminal iccid(String iccid) { /** * The integrated circuit card identifier (ICCID) of the SIM card in the terminal. * @return iccid + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The integrated circuit card identifier (ICCID) of the SIM card in the terminal.") public String getIccid() { @@ -377,6 +432,7 @@ public String getIccid() { } + @Deprecated public void setIccid(String iccid) { this.iccid = iccid; } @@ -404,6 +460,7 @@ public void setId(String id) { } + @Deprecated public Terminal lastActivityDateTime(OffsetDateTime lastActivityDateTime) { this.lastActivityDateTime = lastActivityDateTime; @@ -413,7 +470,9 @@ public Terminal lastActivityDateTime(OffsetDateTime lastActivityDateTime) { /** * Date and time of the last activity on the terminal. Not included when the last activity was more than 14 days ago. * @return lastActivityDateTime + * @deprecated **/ + @Deprecated @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 OffsetDateTime getLastActivityDateTime() { @@ -421,11 +480,13 @@ public OffsetDateTime getLastActivityDateTime() { } + @Deprecated public void setLastActivityDateTime(OffsetDateTime lastActivityDateTime) { this.lastActivityDateTime = lastActivityDateTime; } + @Deprecated public Terminal lastTransactionDateTime(OffsetDateTime lastTransactionDateTime) { this.lastTransactionDateTime = lastTransactionDateTime; @@ -435,7 +496,9 @@ public Terminal lastTransactionDateTime(OffsetDateTime lastTransactionDateTime) /** * Date and time of the last transaction on the terminal. Not included when the last transaction was more than 14 days ago. * @return lastTransactionDateTime + * @deprecated **/ + @Deprecated @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 OffsetDateTime getLastTransactionDateTime() { @@ -443,11 +506,13 @@ public OffsetDateTime getLastTransactionDateTime() { } + @Deprecated public void setLastTransactionDateTime(OffsetDateTime lastTransactionDateTime) { this.lastTransactionDateTime = lastTransactionDateTime; } + @Deprecated public Terminal linkNegotiation(String linkNegotiation) { this.linkNegotiation = linkNegotiation; @@ -457,7 +522,9 @@ public Terminal linkNegotiation(String linkNegotiation) { /** * The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex * @return linkNegotiation + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The Ethernet link negotiation that the terminal uses: - `auto`: Auto-negotiation - `100full`: 100 Mbps full duplex") public String getLinkNegotiation() { @@ -465,6 +532,7 @@ public String getLinkNegotiation() { } + @Deprecated public void setLinkNegotiation(String linkNegotiation) { this.linkNegotiation = linkNegotiation; } @@ -492,6 +560,7 @@ public void setSerialNumber(String serialNumber) { } + @Deprecated public Terminal simStatus(String simStatus) { this.simStatus = simStatus; @@ -501,7 +570,9 @@ public Terminal simStatus(String simStatus) { /** * On a terminal that supports 3G or 4G connectivity, indicates the status of the SIM card in the terminal: ACTIVE or INVENTORY. * @return simStatus + * @deprecated **/ + @Deprecated @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() { @@ -509,11 +580,13 @@ public String getSimStatus() { } + @Deprecated public void setSimStatus(String simStatus) { this.simStatus = simStatus; } + @Deprecated public Terminal status(String status) { this.status = status; @@ -523,7 +596,9 @@ public Terminal status(String status) { /** * Indicates when the terminal was last online, whether the terminal is being reassigned, or whether the terminal is turned off. If the terminal was last online more that a week ago, it is also shown as turned off. * @return status + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "Indicates when the terminal was last online, whether the terminal is being reassigned, or whether the terminal is turned off. If the terminal was last online more that a week ago, it is also shown as turned off.") public String getStatus() { @@ -531,11 +606,13 @@ public String getStatus() { } + @Deprecated public void setStatus(String status) { this.status = status; } + @Deprecated public Terminal storeStatus(String storeStatus) { this.storeStatus = storeStatus; @@ -545,7 +622,9 @@ public Terminal storeStatus(String storeStatus) { /** * The status of the store that the terminal is assigned to. * @return storeStatus + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The status of the store that the terminal is assigned to.") public String getStoreStatus() { @@ -553,11 +632,13 @@ public String getStoreStatus() { } + @Deprecated public void setStoreStatus(String storeStatus) { this.storeStatus = storeStatus; } + @Deprecated public Terminal wifiIp(String wifiIp) { this.wifiIp = wifiIp; @@ -567,7 +648,9 @@ public Terminal wifiIp(String wifiIp) { /** * The terminal's IP address in your Wi-Fi network. * @return wifiIp + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The terminal's IP address in your Wi-Fi network.") public String getWifiIp() { @@ -575,11 +658,13 @@ public String getWifiIp() { } + @Deprecated public void setWifiIp(String wifiIp) { this.wifiIp = wifiIp; } + @Deprecated public Terminal wifiMac(String wifiMac) { this.wifiMac = wifiMac; @@ -589,7 +674,9 @@ public Terminal wifiMac(String wifiMac) { /** * The terminal's MAC address in your Wi-Fi network. * @return wifiMac + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The terminal's MAC address in your Wi-Fi network.") public String getWifiMac() { @@ -597,11 +684,13 @@ public String getWifiMac() { } + @Deprecated public void setWifiMac(String wifiMac) { this.wifiMac = wifiMac; } + @Deprecated public Terminal wifiSsid(String wifiSsid) { this.wifiSsid = wifiSsid; @@ -611,7 +700,9 @@ public Terminal wifiSsid(String wifiSsid) { /** * The SSID of the Wi-Fi network that your terminal is connected to. * @return wifiSsid + * @deprecated **/ + @Deprecated @ApiModelProperty(value = "The SSID of the Wi-Fi network that your terminal is connected to.") public String getWifiSsid() { @@ -619,6 +710,7 @@ public String getWifiSsid() { } + @Deprecated public void setWifiSsid(String wifiSsid) { this.wifiSsid = wifiSsid; } @@ -737,6 +829,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Terminal.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -757,84 +853,84 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Terminal.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Terminal` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Terminal` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 storeStatus if (jsonObj.get("storeStatus") != null && !jsonObj.get("storeStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storeStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `storeStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storeStatus").toString())); } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `wifiMac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wifiMac").toString())); } // validate the optional field wifiSsid if (jsonObj.get("wifiSsid") != null && !jsonObj.get("wifiSsid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `wifiSsid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wifiSsid").toString())); + log.log(Level.WARNING, String.format("Expected the field `wifiSsid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wifiSsid").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TerminalActionScheduleDetail.java b/src/main/java/com/adyen/model/management/TerminalActionScheduleDetail.java index 2c1a98efb..5d9acd6d6 100644 --- a/src/main/java/com/adyen/model/management/TerminalActionScheduleDetail.java +++ b/src/main/java/com/adyen/model/management/TerminalActionScheduleDetail.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalActionScheduleDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,16 +182,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalActionScheduleDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalActionScheduleDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalActionScheduleDetail` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field terminalId if (jsonObj.get("terminalId") != null && !jsonObj.get("terminalId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TerminalModelsResponse.java b/src/main/java/com/adyen/model/management/TerminalModelsResponse.java index e8ffd95ee..ee858da6e 100644 --- a/src/main/java/com/adyen/model/management/TerminalModelsResponse.java +++ b/src/main/java/com/adyen/model/management/TerminalModelsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalModelsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalModelsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalModelsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalModelsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/TerminalOrder.java b/src/main/java/com/adyen/model/management/TerminalOrder.java index 98da1691e..d94742f0e 100644 --- a/src/main/java/com/adyen/model/management/TerminalOrder.java +++ b/src/main/java/com/adyen/model/management/TerminalOrder.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -343,6 +345,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalOrder.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -363,7 +369,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalOrder.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalOrder` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalOrder` properties.", entry.getKey())); } } // validate the optional field `billingEntity` @@ -372,11 +378,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field customerOrderReference if (jsonObj.get("customerOrderReference") != null && !jsonObj.get("customerOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `customerOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `customerOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerOrderReference").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); if (jsonArrayitems != null) { @@ -392,7 +398,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderDate if (jsonObj.get("orderDate") != null && !jsonObj.get("orderDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderDate").toString())); } // validate the optional field `shippingLocation` if (jsonObj.getAsJsonObject("shippingLocation") != null) { @@ -400,11 +406,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 trackingUrl if (jsonObj.get("trackingUrl") != null && !jsonObj.get("trackingUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `trackingUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trackingUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `trackingUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trackingUrl").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TerminalOrderRequest.java b/src/main/java/com/adyen/model/management/TerminalOrderRequest.java index dc55568d0..3f91f32bd 100644 --- a/src/main/java/com/adyen/model/management/TerminalOrderRequest.java +++ b/src/main/java/com/adyen/model/management/TerminalOrderRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -63,6 +65,10 @@ public class TerminalOrderRequest { @SerializedName(SERIALIZED_NAME_ITEMS) private List items = null; + public static final String SERIALIZED_NAME_ORDER_TYPE = "orderType"; + @SerializedName(SERIALIZED_NAME_ORDER_TYPE) + private String orderType; + public static final String SERIALIZED_NAME_SHIPPING_LOCATION_ID = "shippingLocationId"; @SerializedName(SERIALIZED_NAME_SHIPPING_LOCATION_ID) private String shippingLocationId; @@ -148,6 +154,28 @@ public void setItems(List items) { } + public TerminalOrderRequest orderType(String orderType) { + + this.orderType = orderType; + return this; + } + + /** + * Type of order + * @return orderType + **/ + @ApiModelProperty(value = "Type of order") + + public String getOrderType() { + return orderType; + } + + + public void setOrderType(String orderType) { + this.orderType = orderType; + } + + public TerminalOrderRequest shippingLocationId(String shippingLocationId) { this.shippingLocationId = shippingLocationId; @@ -205,13 +233,14 @@ public boolean equals(Object o) { return Objects.equals(this.billingEntityId, terminalOrderRequest.billingEntityId) && Objects.equals(this.customerOrderReference, terminalOrderRequest.customerOrderReference) && Objects.equals(this.items, terminalOrderRequest.items) && + Objects.equals(this.orderType, terminalOrderRequest.orderType) && Objects.equals(this.shippingLocationId, terminalOrderRequest.shippingLocationId) && Objects.equals(this.taxId, terminalOrderRequest.taxId); } @Override public int hashCode() { - return Objects.hash(billingEntityId, customerOrderReference, items, shippingLocationId, taxId); + return Objects.hash(billingEntityId, customerOrderReference, items, orderType, shippingLocationId, taxId); } @Override @@ -221,6 +250,7 @@ public String toString() { sb.append(" billingEntityId: ").append(toIndentedString(billingEntityId)).append("\n"); sb.append(" customerOrderReference: ").append(toIndentedString(customerOrderReference)).append("\n"); sb.append(" items: ").append(toIndentedString(items)).append("\n"); + sb.append(" orderType: ").append(toIndentedString(orderType)).append("\n"); sb.append(" shippingLocationId: ").append(toIndentedString(shippingLocationId)).append("\n"); sb.append(" taxId: ").append(toIndentedString(taxId)).append("\n"); sb.append("}"); @@ -248,12 +278,17 @@ private String toIndentedString(Object o) { openapiFields.add("billingEntityId"); openapiFields.add("customerOrderReference"); openapiFields.add("items"); + openapiFields.add("orderType"); openapiFields.add("shippingLocationId"); openapiFields.add("taxId"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalOrderRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -274,16 +309,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalOrderRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalOrderRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalOrderRequest` properties.", entry.getKey())); } } // validate the optional field billingEntityId if (jsonObj.get("billingEntityId") != null && !jsonObj.get("billingEntityId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingEntityId").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingEntityId").toString())); } // validate the optional field customerOrderReference if (jsonObj.get("customerOrderReference") != null && !jsonObj.get("customerOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `customerOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `customerOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customerOrderReference").toString())); } JsonArray jsonArrayitems = jsonObj.getAsJsonArray("items"); if (jsonArrayitems != null) { @@ -297,13 +332,17 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { OrderItem.validateJsonObject(jsonArrayitems.get(i).getAsJsonObject()); } } + // validate the optional field orderType + if (jsonObj.get("orderType") != null && !jsonObj.get("orderType").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `orderType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderType").toString())); + } // validate the optional field shippingLocationId if (jsonObj.get("shippingLocationId") != null && !jsonObj.get("shippingLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shippingLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shippingLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `shippingLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shippingLocationId").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java b/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java index a6f42feab..7b265098e 100644 --- a/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java +++ b/src/main/java/com/adyen/model/management/TerminalOrdersResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalOrdersResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalOrdersResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalOrdersResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalOrdersResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/TerminalProduct.java b/src/main/java/com/adyen/model/management/TerminalProduct.java index af2fc0ef6..2a23012ed 100644 --- a/src/main/java/com/adyen/model/management/TerminalProduct.java +++ b/src/main/java/com/adyen/model/management/TerminalProduct.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -254,6 +256,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalProduct.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -274,24 +280,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalProduct.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalProduct` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalProduct` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the json data is an array if (jsonObj.get("itemsIncluded") != null && !jsonObj.get("itemsIncluded").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `itemsIncluded` to be an array in the JSON string but got `%s`", jsonObj.get("itemsIncluded").toString())); + log.log(Level.WARNING, String.format("Expected the field `itemsIncluded` to be an array in the JSON string but got `%s`", jsonObj.get("itemsIncluded").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field `price` if (jsonObj.getAsJsonObject("price") != null) { diff --git a/src/main/java/com/adyen/model/management/TerminalProductPrice.java b/src/main/java/com/adyen/model/management/TerminalProductPrice.java index 8d19e13f0..be303825a 100644 --- a/src/main/java/com/adyen/model/management/TerminalProductPrice.java +++ b/src/main/java/com/adyen/model/management/TerminalProductPrice.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -156,6 +158,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalProductPrice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -176,12 +182,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalProductPrice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalProductPrice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalProductPrice` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TerminalProductsResponse.java b/src/main/java/com/adyen/model/management/TerminalProductsResponse.java index afd538851..9642a83fc 100644 --- a/src/main/java/com/adyen/model/management/TerminalProductsResponse.java +++ b/src/main/java/com/adyen/model/management/TerminalProductsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalProductsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalProductsResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalProductsResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalProductsResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/TerminalSettings.java b/src/main/java/com/adyen/model/management/TerminalSettings.java index 57e08ef5b..0326f9d90 100644 --- a/src/main/java/com/adyen/model/management/TerminalSettings.java +++ b/src/main/java/com/adyen/model/management/TerminalSettings.java @@ -59,6 +59,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -618,6 +620,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TerminalSettings.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -638,7 +644,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TerminalSettings.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TerminalSettings` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TerminalSettings` properties.", entry.getKey())); } } // validate the optional field `cardholderReceipt` diff --git a/src/main/java/com/adyen/model/management/TestCompanyWebhookRequest.java b/src/main/java/com/adyen/model/management/TestCompanyWebhookRequest.java index afe30fe4b..e84317942 100644 --- a/src/main/java/com/adyen/model/management/TestCompanyWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/TestCompanyWebhookRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -204,6 +206,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TestCompanyWebhookRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -224,12 +230,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TestCompanyWebhookRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestCompanyWebhookRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TestCompanyWebhookRequest` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("merchantIds") != null && !jsonObj.get("merchantIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantIds` to be an array in the JSON string but got `%s`", jsonObj.get("merchantIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantIds` to be an array in the JSON string but got `%s`", jsonObj.get("merchantIds").toString())); } // validate the optional field `notification` if (jsonObj.getAsJsonObject("notification") != null) { @@ -237,7 +243,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("types") != null && !jsonObj.get("types").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `types` to be an array in the JSON string but got `%s`", jsonObj.get("types").toString())); + log.log(Level.WARNING, String.format("Expected the field `types` to be an array in the JSON string but got `%s`", jsonObj.get("types").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TestOutput.java b/src/main/java/com/adyen/model/management/TestOutput.java index 3549e7aa0..8e165d6d3 100644 --- a/src/main/java/com/adyen/model/management/TestOutput.java +++ b/src/main/java/com/adyen/model/management/TestOutput.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TestOutput.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,7 +299,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TestOutput.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestOutput` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TestOutput` properties.", entry.getKey())); } } @@ -305,27 +311,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `merchantId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantId").toString())); } // validate the optional field output if (jsonObj.get("output") != null && !jsonObj.get("output").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); + log.log(Level.WARNING, String.format("Expected the field `output` to be a primitive type in the JSON string but got `%s`", jsonObj.get("output").toString())); } // validate the optional field requestSent if (jsonObj.get("requestSent") != null && !jsonObj.get("requestSent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestSent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestSent").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestSent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestSent").toString())); } // validate the optional field responseCode if (jsonObj.get("responseCode") != null && !jsonObj.get("responseCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `responseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `responseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseCode").toString())); } // validate the optional field responseTime if (jsonObj.get("responseTime") != null && !jsonObj.get("responseTime").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `responseTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseTime").toString())); + log.log(Level.WARNING, String.format("Expected the field `responseTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("responseTime").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())); + log.log(Level.WARNING, String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TestWebhookRequest.java b/src/main/java/com/adyen/model/management/TestWebhookRequest.java index f43187b79..85efc279b 100644 --- a/src/main/java/com/adyen/model/management/TestWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/TestWebhookRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TestWebhookRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TestWebhookRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestWebhookRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TestWebhookRequest` properties.", entry.getKey())); } } // validate the optional field `notification` @@ -196,7 +202,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("types") != null && !jsonObj.get("types").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `types` to be an array in the JSON string but got `%s`", jsonObj.get("types").toString())); + log.log(Level.WARNING, String.format("Expected the field `types` to be an array in the JSON string but got `%s`", jsonObj.get("types").toString())); } } diff --git a/src/main/java/com/adyen/model/management/TestWebhookResponse.java b/src/main/java/com/adyen/model/management/TestWebhookResponse.java index 1a6b67a7f..427bf7ee5 100644 --- a/src/main/java/com/adyen/model/management/TestWebhookResponse.java +++ b/src/main/java/com/adyen/model/management/TestWebhookResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -138,6 +140,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TestWebhookResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -158,7 +164,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TestWebhookResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TestWebhookResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TestWebhookResponse` properties.", entry.getKey())); } } JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); diff --git a/src/main/java/com/adyen/model/management/Timeouts.java b/src/main/java/com/adyen/model/management/Timeouts.java index 73693f1c0..c82185817 100644 --- a/src/main/java/com/adyen/model/management/Timeouts.java +++ b/src/main/java/com/adyen/model/management/Timeouts.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Timeouts.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,7 +153,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Timeouts.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Timeouts` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Timeouts` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/management/TwintInfo.java b/src/main/java/com/adyen/model/management/TwintInfo.java new file mode 100644 index 000000000..fee5c7dd5 --- /dev/null +++ b/src/main/java/com/adyen/model/management/TwintInfo.java @@ -0,0 +1,222 @@ +/* + * 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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.management.JSON; + +/** + * TwintInfo + */ + +public class TwintInfo { + public static final String SERIALIZED_NAME_LOGO = "logo"; + @SerializedName(SERIALIZED_NAME_LOGO) + private String logo; + + public TwintInfo() { + } + + public TwintInfo logo(String logo) { + + this.logo = logo; + return this; + } + + /** + * Twint logo. Format: Base64-encoded string. + * @return logo + **/ + @ApiModelProperty(required = true, value = "Twint logo. Format: Base64-encoded string.") + + public String getLogo() { + return logo; + } + + + public void setLogo(String logo) { + this.logo = logo; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwintInfo twintInfo = (TwintInfo) o; + return Objects.equals(this.logo, twintInfo.logo); + } + + @Override + public int hashCode() { + return Objects.hash(logo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwintInfo {\n"); + sb.append(" logo: ").append(toIndentedString(logo)).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("logo"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("logo"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TwintInfo.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TwintInfo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TwintInfo.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TwintInfo is not found in the empty JSON string", TwintInfo.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TwintInfo.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TwintInfo` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TwintInfo.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()) { + log.log(Level.WARNING, String.format("Expected the field `logo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TwintInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwintInfo' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwintInfo.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TwintInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TwintInfo read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwintInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwintInfo + * @throws IOException if the JSON string is invalid with respect to TwintInfo + */ + public static TwintInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwintInfo.class); + } + + /** + * Convert an instance of TwintInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/management/UninstallAndroidAppDetails.java b/src/main/java/com/adyen/model/management/UninstallAndroidAppDetails.java index f69a391bf..5f0c616fe 100644 --- a/src/main/java/com/adyen/model/management/UninstallAndroidAppDetails.java +++ b/src/main/java/com/adyen/model/management/UninstallAndroidAppDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UninstallAndroidAppDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,12 +227,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UninstallAndroidAppDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UninstallAndroidAppDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UninstallAndroidAppDetails` properties.", entry.getKey())); } } // validate the optional field appId if (jsonObj.get("appId") != null && !jsonObj.get("appId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); + log.log(Level.WARNING, String.format("Expected the field `appId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appId").toString())); } // 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/management/UninstallAndroidCertificateDetails.java b/src/main/java/com/adyen/model/management/UninstallAndroidCertificateDetails.java index 2bb3a4135..eec1f1e64 100644 --- a/src/main/java/com/adyen/model/management/UninstallAndroidCertificateDetails.java +++ b/src/main/java/com/adyen/model/management/UninstallAndroidCertificateDetails.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -201,6 +203,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UninstallAndroidCertificateDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -221,12 +227,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UninstallAndroidCertificateDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UninstallAndroidCertificateDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UninstallAndroidCertificateDetails` properties.", entry.getKey())); } } // validate the optional field certificateId if (jsonObj.get("certificateId") != null && !jsonObj.get("certificateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certificateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certificateId").toString())); + log.log(Level.WARNING, String.format("Expected the field `certificateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certificateId").toString())); } // 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/management/UpdatableAddress.java b/src/main/java/com/adyen/model/management/UpdatableAddress.java index e8175a9bb..60ff15bfe 100644 --- a/src/main/java/com/adyen/model/management/UpdatableAddress.java +++ b/src/main/java/com/adyen/model/management/UpdatableAddress.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -272,6 +274,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdatableAddress.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -292,32 +298,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdatableAddress.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatableAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdatableAddress` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 line1 if (jsonObj.get("line1") != null && !jsonObj.get("line1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); + log.log(Level.WARNING, String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); } // validate the optional field line2 if (jsonObj.get("line2") != null && !jsonObj.get("line2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); + log.log(Level.WARNING, String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); } // validate the optional field line3 if (jsonObj.get("line3") != null && !jsonObj.get("line3").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line3").toString())); + log.log(Level.WARNING, String.format("Expected the field `line3` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line3").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateOrProvince").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdateCompanyApiCredentialRequest.java b/src/main/java/com/adyen/model/management/UpdateCompanyApiCredentialRequest.java index ec91a478f..289aa8f2c 100644 --- a/src/main/java/com/adyen/model/management/UpdateCompanyApiCredentialRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateCompanyApiCredentialRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -269,6 +271,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateCompanyApiCredentialRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -289,24 +295,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateCompanyApiCredentialRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCompanyApiCredentialRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateCompanyApiCredentialRequest` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("allowedOrigins") != null && !jsonObj.get("allowedOrigins").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").toString())); } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").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())); + log.log(Level.WARNING, 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("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java b/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java index f1d9af219..b8c18049b 100644 --- a/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateCompanyUserRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -63,14 +65,6 @@ 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; @@ -172,66 +166,6 @@ 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; @@ -341,8 +275,6 @@ 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) && @@ -351,7 +283,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, active, associatedMerchantAccounts, authnAppsToAdd, authnAppsToRemove, email, name, roles, timeZoneCode); + return Objects.hash(accountGroups, active, associatedMerchantAccounts, email, name, roles, timeZoneCode); } @Override @@ -361,8 +293,6 @@ 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"); @@ -392,8 +322,6 @@ 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"); @@ -402,6 +330,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateCompanyUserRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -422,28 +354,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateCompanyUserRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateCompanyUserRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateCompanyUserRequest` properties.", entry.getKey())); } } // ensure the json data is an array 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())); + log.log(Level.WARNING, 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("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())); + log.log(Level.WARNING, String.format("Expected the field `associatedMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("associatedMerchantAccounts").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -451,11 +375,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java b/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java index 55a7b5b23..42a292245 100644 --- a/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateCompanyWebhookRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -748,6 +750,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateCompanyWebhookRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -768,7 +774,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateCompanyWebhookRequest.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateCompanyWebhookRequest` properties.", entry.getKey())); } } // validate the optional field `additionalSettings` @@ -784,7 +790,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // ensure the field filterMerchantAccountType can be parsed to an enum value if (jsonObj.get("filterMerchantAccountType") != null) { @@ -795,7 +801,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("filterMerchantAccounts") != null && !jsonObj.get("filterMerchantAccounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `filterMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("filterMerchantAccounts").toString())); + log.log(Level.WARNING, String.format("Expected the field `filterMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("filterMerchantAccounts").toString())); } // ensure the field networkType can be parsed to an enum value if (jsonObj.get("networkType") != null) { @@ -806,7 +812,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // ensure the field sslVersion can be parsed to an enum value if (jsonObj.get("sslVersion") != null) { @@ -817,11 +823,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdateMerchantApiCredentialRequest.java b/src/main/java/com/adyen/model/management/UpdateMerchantApiCredentialRequest.java index cb3aefc05..58c593985 100644 --- a/src/main/java/com/adyen/model/management/UpdateMerchantApiCredentialRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateMerchantApiCredentialRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -232,6 +234,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateMerchantApiCredentialRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -252,20 +258,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateMerchantApiCredentialRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateMerchantApiCredentialRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateMerchantApiCredentialRequest` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("allowedOrigins") != null && !jsonObj.get("allowedOrigins").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowedOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("allowedOrigins").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())); + log.log(Level.WARNING, 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("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java b/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java index cfe518d3c..90246d00b 100644 --- a/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateMerchantUserRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -59,14 +61,6 @@ 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; @@ -138,66 +132,6 @@ 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; @@ -306,8 +240,6 @@ 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) && @@ -316,7 +248,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountGroups, active, authnAppsToAdd, authnAppsToRemove, email, name, roles, timeZoneCode); + return Objects.hash(accountGroups, active, email, name, roles, timeZoneCode); } @Override @@ -325,8 +257,6 @@ 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"); @@ -355,8 +285,6 @@ 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"); @@ -365,6 +293,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateMerchantUserRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -385,24 +317,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateMerchantUserRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateMerchantUserRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateMerchantUserRequest` properties.", entry.getKey())); } } // ensure the json data is an array 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())); + log.log(Level.WARNING, String.format("Expected the field `accountGroups` to be an array in the JSON string but got `%s`", jsonObj.get("accountGroups").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -410,11 +334,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java b/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java index 3221c4154..27afaf423 100644 --- a/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateMerchantWebhookRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -631,6 +633,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateMerchantWebhookRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -651,7 +657,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateMerchantWebhookRequest.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateMerchantWebhookRequest` properties.", entry.getKey())); } } // validate the optional field `additionalSettings` @@ -667,7 +673,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // ensure the field networkType can be parsed to an enum value if (jsonObj.get("networkType") != null) { @@ -678,7 +684,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // ensure the field sslVersion can be parsed to an enum value if (jsonObj.get("sslVersion") != null) { @@ -689,11 +695,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java b/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java index 44f91324d..0eb98f3dd 100644 --- a/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java +++ b/src/main/java/com/adyen/model/management/UpdatePaymentMethodInfo.java @@ -14,7 +14,8 @@ import java.util.Objects; import java.util.Arrays; -import com.adyen.model.management.ShopperStatement; +import com.adyen.model.management.BcmcInfo; +import com.adyen.model.management.CartesBancairesInfo; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -51,6 +54,14 @@ */ public class UpdatePaymentMethodInfo { + public static final String SERIALIZED_NAME_BCMC = "bcmc"; + @SerializedName(SERIALIZED_NAME_BCMC) + private BcmcInfo bcmc; + + public static final String SERIALIZED_NAME_CARTES_BANCAIRES = "cartesBancaires"; + @SerializedName(SERIALIZED_NAME_CARTES_BANCAIRES) + private CartesBancairesInfo cartesBancaires; + public static final String SERIALIZED_NAME_COUNTRIES = "countries"; @SerializedName(SERIALIZED_NAME_COUNTRIES) private List countries = null; @@ -59,18 +70,10 @@ public class UpdatePaymentMethodInfo { @SerializedName(SERIALIZED_NAME_CURRENCIES) private List currencies = null; - public static final String SERIALIZED_NAME_CUSTOM_ROUTING_FLAGS = "customRoutingFlags"; - @SerializedName(SERIALIZED_NAME_CUSTOM_ROUTING_FLAGS) - private List customRoutingFlags = null; - public static final String SERIALIZED_NAME_ENABLED = "enabled"; @SerializedName(SERIALIZED_NAME_ENABLED) private Boolean enabled; - public static final String SERIALIZED_NAME_SHOPPER_STATEMENT = "shopperStatement"; - @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; @@ -78,6 +81,50 @@ public class UpdatePaymentMethodInfo { public UpdatePaymentMethodInfo() { } + public UpdatePaymentMethodInfo bcmc(BcmcInfo bcmc) { + + this.bcmc = bcmc; + return this; + } + + /** + * Get bcmc + * @return bcmc + **/ + @ApiModelProperty(value = "") + + public BcmcInfo getBcmc() { + return bcmc; + } + + + public void setBcmc(BcmcInfo bcmc) { + this.bcmc = bcmc; + } + + + public UpdatePaymentMethodInfo cartesBancaires(CartesBancairesInfo cartesBancaires) { + + this.cartesBancaires = cartesBancaires; + return this; + } + + /** + * Get cartesBancaires + * @return cartesBancaires + **/ + @ApiModelProperty(value = "") + + public CartesBancairesInfo getCartesBancaires() { + return cartesBancaires; + } + + + public void setCartesBancaires(CartesBancairesInfo cartesBancaires) { + this.cartesBancaires = cartesBancaires; + } + + public UpdatePaymentMethodInfo countries(List countries) { this.countries = countries; @@ -138,36 +185,6 @@ public void setCurrencies(List currencies) { } - public UpdatePaymentMethodInfo customRoutingFlags(List customRoutingFlags) { - - this.customRoutingFlags = customRoutingFlags; - return this; - } - - public UpdatePaymentMethodInfo addCustomRoutingFlagsItem(String customRoutingFlagsItem) { - if (this.customRoutingFlags == null) { - this.customRoutingFlags = new ArrayList<>(); - } - this.customRoutingFlags.add(customRoutingFlagsItem); - return this; - } - - /** - * Custom routing flags for acquirer routing. - * @return customRoutingFlags - **/ - @ApiModelProperty(value = "Custom routing flags for acquirer routing.") - - public List getCustomRoutingFlags() { - return customRoutingFlags; - } - - - public void setCustomRoutingFlags(List customRoutingFlags) { - this.customRoutingFlags = customRoutingFlags; - } - - public UpdatePaymentMethodInfo enabled(Boolean enabled) { this.enabled = enabled; @@ -190,28 +207,6 @@ public void setEnabled(Boolean enabled) { } - public UpdatePaymentMethodInfo shopperStatement(ShopperStatement shopperStatement) { - - this.shopperStatement = shopperStatement; - return this; - } - - /** - * Get shopperStatement - * @return shopperStatement - **/ - @ApiModelProperty(value = "") - - public ShopperStatement getShopperStatement() { - return shopperStatement; - } - - - public void setShopperStatement(ShopperStatement shopperStatement) { - this.shopperStatement = shopperStatement; - } - - public UpdatePaymentMethodInfo storeIds(List storeIds) { this.storeIds = storeIds; @@ -252,28 +247,28 @@ public boolean equals(Object o) { return false; } UpdatePaymentMethodInfo updatePaymentMethodInfo = (UpdatePaymentMethodInfo) o; - return Objects.equals(this.countries, updatePaymentMethodInfo.countries) && + return Objects.equals(this.bcmc, updatePaymentMethodInfo.bcmc) && + Objects.equals(this.cartesBancaires, updatePaymentMethodInfo.cartesBancaires) && + Objects.equals(this.countries, updatePaymentMethodInfo.countries) && 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.storeIds, updatePaymentMethodInfo.storeIds); } @Override public int hashCode() { - return Objects.hash(countries, currencies, customRoutingFlags, enabled, shopperStatement, storeIds); + return Objects.hash(bcmc, cartesBancaires, countries, currencies, enabled, storeIds); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UpdatePaymentMethodInfo {\n"); + sb.append(" bcmc: ").append(toIndentedString(bcmc)).append("\n"); + sb.append(" cartesBancaires: ").append(toIndentedString(cartesBancaires)).append("\n"); sb.append(" countries: ").append(toIndentedString(countries)).append("\n"); sb.append(" currencies: ").append(toIndentedString(currencies)).append("\n"); - 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(); @@ -297,16 +292,20 @@ private String toIndentedString(Object o) { static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); + openapiFields.add("bcmc"); + openapiFields.add("cartesBancaires"); openapiFields.add("countries"); openapiFields.add("currencies"); - openapiFields.add("customRoutingFlags"); openapiFields.add("enabled"); - openapiFields.add("shopperStatement"); openapiFields.add("storeIds"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdatePaymentMethodInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -327,28 +326,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdatePaymentMethodInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePaymentMethodInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdatePaymentMethodInfo` properties.", entry.getKey())); } } + // validate the optional field `bcmc` + if (jsonObj.getAsJsonObject("bcmc") != null) { + BcmcInfo.validateJsonObject(jsonObj.getAsJsonObject("bcmc")); + } + // validate the optional field `cartesBancaires` + if (jsonObj.getAsJsonObject("cartesBancaires") != null) { + CartesBancairesInfo.validateJsonObject(jsonObj.getAsJsonObject("cartesBancaires")); + } // ensure the json data is an array if (jsonObj.get("countries") != null && !jsonObj.get("countries").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `countries` to be an array in the JSON string but got `%s`", jsonObj.get("countries").toString())); + log.log(Level.WARNING, String.format("Expected the field `countries` to be an array in the JSON string but got `%s`", jsonObj.get("countries").toString())); } // ensure the json data is an array if (jsonObj.get("currencies") != null && !jsonObj.get("currencies").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `currencies` to be an array in the JSON string but got `%s`", jsonObj.get("currencies").toString())); - } - // ensure the json data is an array - if (jsonObj.get("customRoutingFlags") != null && !jsonObj.get("customRoutingFlags").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `customRoutingFlags` to be an array in the JSON string but got `%s`", jsonObj.get("customRoutingFlags").toString())); - } - // validate the optional field `shopperStatement` - if (jsonObj.getAsJsonObject("shopperStatement") != null) { - ShopperStatement.validateJsonObject(jsonObj.getAsJsonObject("shopperStatement")); + log.log(Level.WARNING, String.format("Expected the field `currencies` to be an array in the JSON string but got `%s`", jsonObj.get("currencies").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `storeIds` to be an array in the JSON string but got `%s`", jsonObj.get("storeIds").toString())); } } diff --git a/src/main/java/com/adyen/model/management/UpdatePayoutSettingsRequest.java b/src/main/java/com/adyen/model/management/UpdatePayoutSettingsRequest.java index 38673a740..072823693 100644 --- a/src/main/java/com/adyen/model/management/UpdatePayoutSettingsRequest.java +++ b/src/main/java/com/adyen/model/management/UpdatePayoutSettingsRequest.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdatePayoutSettingsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,7 +153,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdatePayoutSettingsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdatePayoutSettingsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdatePayoutSettingsRequest` properties.", entry.getKey())); } } } diff --git a/src/main/java/com/adyen/model/management/UpdateStoreRequest.java b/src/main/java/com/adyen/model/management/UpdateStoreRequest.java index 0bf4af78c..7fa6d0403 100644 --- a/src/main/java/com/adyen/model/management/UpdateStoreRequest.java +++ b/src/main/java/com/adyen/model/management/UpdateStoreRequest.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -333,6 +335,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UpdateStoreRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -353,7 +359,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!UpdateStoreRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `UpdateStoreRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UpdateStoreRequest` properties.", entry.getKey())); } } // validate the optional field `address` @@ -362,15 +368,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("businessLineIds") != null && !jsonObj.get("businessLineIds").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").toString())); + log.log(Level.WARNING, String.format("Expected the field `businessLineIds` to be an array in the JSON string but got `%s`", jsonObj.get("businessLineIds").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())); + log.log(Level.WARNING, 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 externalReferenceId if (jsonObj.get("externalReferenceId") != null && !jsonObj.get("externalReferenceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").toString())); + log.log(Level.WARNING, String.format("Expected the field `externalReferenceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("externalReferenceId").toString())); } // validate the optional field `splitConfiguration` if (jsonObj.getAsJsonObject("splitConfiguration") != null) { diff --git a/src/main/java/com/adyen/model/management/Url.java b/src/main/java/com/adyen/model/management/Url.java index 59ae4f3a1..ec55546b9 100644 --- a/src/main/java/com/adyen/model/management/Url.java +++ b/src/main/java/com/adyen/model/management/Url.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Url.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,20 +240,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Url.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Url` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Url` properties.", entry.getKey())); } } // validate the optional field password if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/User.java b/src/main/java/com/adyen/model/management/User.java index 714812ed9..20bfc78c4 100644 --- a/src/main/java/com/adyen/model/management/User.java +++ b/src/main/java/com/adyen/model/management/User.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -64,9 +66,9 @@ 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_APPS = "apps"; + @SerializedName(SERIALIZED_NAME_APPS) + private List apps = null; public static final String SERIALIZED_NAME_EMAIL = "email"; @SerializedName(SERIALIZED_NAME_EMAIL) @@ -169,33 +171,33 @@ public void setActive(Boolean active) { } - public User authnApps(List authnApps) { + public User apps(List apps) { - this.authnApps = authnApps; + this.apps = apps; return this; } - public User addAuthnAppsItem(String authnAppsItem) { - if (this.authnApps == null) { - this.authnApps = new ArrayList<>(); + public User addAppsItem(String appsItem) { + if (this.apps == null) { + this.apps = new ArrayList<>(); } - this.authnApps.add(authnAppsItem); + this.apps.add(appsItem); return this; } /** - * Set of authn apps available to this user - * @return authnApps + * Set of apps available to this user + * @return apps **/ - @ApiModelProperty(value = "Set of authn apps available to this user") + @ApiModelProperty(value = "Set of apps available to this user") - public List getAuthnApps() { - return authnApps; + public List getApps() { + return apps; } - public void setAuthnApps(List authnApps) { - this.authnApps = authnApps; + public void setApps(List apps) { + this.apps = apps; } @@ -349,7 +351,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.apps, user.apps) && Objects.equals(this.email, user.email) && Objects.equals(this.id, user.id) && Objects.equals(this.name, user.name) && @@ -360,7 +362,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(links, accountGroups, active, authnApps, email, id, name, roles, timeZoneCode, username); + return Objects.hash(links, accountGroups, active, apps, email, id, name, roles, timeZoneCode, username); } @Override @@ -370,7 +372,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(" apps: ").append(toIndentedString(apps)).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"); @@ -402,7 +404,7 @@ private String toIndentedString(Object o) { openapiFields.add("_links"); openapiFields.add("accountGroups"); openapiFields.add("active"); - openapiFields.add("authnApps"); + openapiFields.add("apps"); openapiFields.add("email"); openapiFields.add("id"); openapiFields.add("name"); @@ -418,6 +420,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timeZoneCode"); openapiRequiredFields.add("username"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(User.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -438,7 +444,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!User.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `User` properties.", entry.getKey())); } } @@ -454,19 +460,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array 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())); + log.log(Level.WARNING, 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())); + if (jsonObj.get("apps") != null && !jsonObj.get("apps").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `apps` to be an array in the JSON string but got `%s`", jsonObj.get("apps").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())); + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `name` if (jsonObj.getAsJsonObject("name") != null) { @@ -474,15 +480,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("roles") != null && !jsonObj.get("roles").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + log.log(Level.WARNING, String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); } // validate the optional field timeZoneCode if (jsonObj.get("timeZoneCode") != null && !jsonObj.get("timeZoneCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `timeZoneCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timeZoneCode").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/VippsInfo.java b/src/main/java/com/adyen/model/management/VippsInfo.java index a5fdaf0ae..4dfd8aec8 100644 --- a/src/main/java/com/adyen/model/management/VippsInfo.java +++ b/src/main/java/com/adyen/model/management/VippsInfo.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -88,10 +90,10 @@ public VippsInfo subscriptionCancelUrl(String subscriptionCancelUrl) { } /** - * Vipps subscription cancel url + * Vipps subscription cancel url (required in case of [recurring payments](https://docs.adyen.com/online-payments/tokenization)) * @return subscriptionCancelUrl **/ - @ApiModelProperty(value = "Vipps subscription cancel url") + @ApiModelProperty(value = "Vipps subscription cancel url (required in case of [recurring payments](https://docs.adyen.com/online-payments/tokenization))") public String getSubscriptionCancelUrl() { return subscriptionCancelUrl; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("logo"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VippsInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VippsInfo` properties.", entry.getKey())); } } @@ -189,11 +195,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `subscriptionCancelUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriptionCancelUrl").toString())); } } diff --git a/src/main/java/com/adyen/model/management/Webhook.java b/src/main/java/com/adyen/model/management/Webhook.java index cdf2cca50..3565b098c 100644 --- a/src/main/java/com/adyen/model/management/Webhook.java +++ b/src/main/java/com/adyen/model/management/Webhook.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -956,6 +958,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("type"); openapiRequiredFields.add("url"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Webhook.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -976,7 +982,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Webhook.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Webhook` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Webhook` properties.", entry.getKey())); } } @@ -992,7 +998,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field accountReference if (jsonObj.get("accountReference") != null && !jsonObj.get("accountReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `accountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `accountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountReference").toString())); } // validate the optional field `additionalSettings` if (jsonObj.getAsJsonObject("additionalSettings") != null) { @@ -1000,7 +1006,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field certificateAlias if (jsonObj.get("certificateAlias") != null && !jsonObj.get("certificateAlias").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `certificateAlias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certificateAlias").toString())); + log.log(Level.WARNING, String.format("Expected the field `certificateAlias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("certificateAlias").toString())); } // ensure the field communicationFormat can be parsed to an enum value if (jsonObj.get("communicationFormat") != null) { @@ -1011,7 +1017,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // ensure the field filterMerchantAccountType can be parsed to an enum value if (jsonObj.get("filterMerchantAccountType") != null) { @@ -1022,15 +1028,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("filterMerchantAccounts") != null && !jsonObj.get("filterMerchantAccounts").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `filterMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("filterMerchantAccounts").toString())); + log.log(Level.WARNING, String.format("Expected the field `filterMerchantAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("filterMerchantAccounts").toString())); } // validate the optional field hmacKeyCheckValue if (jsonObj.get("hmacKeyCheckValue") != null && !jsonObj.get("hmacKeyCheckValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `hmacKeyCheckValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hmacKeyCheckValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `hmacKeyCheckValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("hmacKeyCheckValue").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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // ensure the field networkType can be parsed to an enum value if (jsonObj.get("networkType") != null) { @@ -1048,15 +1054,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } // validate the optional field url if (jsonObj.get("url") != null && !jsonObj.get("url").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); + log.log(Level.WARNING, String.format("Expected the field `url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("url").toString())); } // validate the optional field username if (jsonObj.get("username") != null && !jsonObj.get("username").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + log.log(Level.WARNING, String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); } } diff --git a/src/main/java/com/adyen/model/management/WebhookLinks.java b/src/main/java/com/adyen/model/management/WebhookLinks.java index 936dd7607..4896a8cdc 100644 --- a/src/main/java/com/adyen/model/management/WebhookLinks.java +++ b/src/main/java/com/adyen/model/management/WebhookLinks.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -247,6 +249,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("self"); openapiRequiredFields.add("testWebhook"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(WebhookLinks.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -267,7 +273,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!WebhookLinks.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WebhookLinks` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `WebhookLinks` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/management/WifiProfiles.java b/src/main/java/com/adyen/model/management/WifiProfiles.java index d6554382c..f3806c419 100644 --- a/src/main/java/com/adyen/model/management/WifiProfiles.java +++ b/src/main/java/com/adyen/model/management/WifiProfiles.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.management.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(WifiProfiles.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!WifiProfiles.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `WifiProfiles` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `WifiProfiles` properties.", entry.getKey())); } } JsonArray jsonArrayprofiles = jsonObj.getAsJsonArray("profiles"); diff --git a/src/main/java/com/adyen/model/payment/AccountInfo.java b/src/main/java/com/adyen/model/payment/AccountInfo.java index 75706a32f..0628f5252 100644 --- a/src/main/java/com/adyen/model/payment/AccountInfo.java +++ b/src/main/java/com/adyen/model/payment/AccountInfo.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -976,6 +978,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -996,7 +1002,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AccountInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AccountInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountInfo` properties.", entry.getKey())); } } // ensure the field accountAgeIndicator can be parsed to an enum value @@ -1029,11 +1035,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field homePhone if (jsonObj.get("homePhone") != null && !jsonObj.get("homePhone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `homePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("homePhone").toString())); + log.log(Level.WARNING, String.format("Expected the field `homePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("homePhone").toString())); } // validate the optional field mobilePhone if (jsonObj.get("mobilePhone") != null && !jsonObj.get("mobilePhone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mobilePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobilePhone").toString())); + log.log(Level.WARNING, String.format("Expected the field `mobilePhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobilePhone").toString())); } // ensure the field passwordChangeIndicator can be parsed to an enum value if (jsonObj.get("passwordChangeIndicator") != null) { @@ -1051,7 +1057,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field workPhone if (jsonObj.get("workPhone") != null && !jsonObj.get("workPhone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `workPhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workPhone").toString())); + log.log(Level.WARNING, String.format("Expected the field `workPhone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("workPhone").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AcctInfo.java b/src/main/java/com/adyen/model/payment/AcctInfo.java index d9be4a8ec..7acee1c07 100644 --- a/src/main/java/com/adyen/model/payment/AcctInfo.java +++ b/src/main/java/com/adyen/model/payment/AcctInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -918,6 +920,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AcctInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -938,7 +944,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AcctInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AcctInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AcctInfo` properties.", entry.getKey())); } } // ensure the field chAccAgeInd can be parsed to an enum value @@ -950,7 +956,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field chAccChange if (jsonObj.get("chAccChange") != null && !jsonObj.get("chAccChange").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `chAccChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccChange").toString())); + log.log(Level.WARNING, String.format("Expected the field `chAccChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccChange").toString())); } // ensure the field chAccChangeInd can be parsed to an enum value if (jsonObj.get("chAccChangeInd") != null) { @@ -961,7 +967,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field chAccPwChange if (jsonObj.get("chAccPwChange") != null && !jsonObj.get("chAccPwChange").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `chAccPwChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccPwChange").toString())); + log.log(Level.WARNING, String.format("Expected the field `chAccPwChange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccPwChange").toString())); } // ensure the field chAccPwChangeInd can be parsed to an enum value if (jsonObj.get("chAccPwChangeInd") != null) { @@ -972,15 +978,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field chAccString if (jsonObj.get("chAccString") != null && !jsonObj.get("chAccString").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `chAccString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccString").toString())); + log.log(Level.WARNING, String.format("Expected the field `chAccString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("chAccString").toString())); } // validate the optional field nbPurchaseAccount if (jsonObj.get("nbPurchaseAccount") != null && !jsonObj.get("nbPurchaseAccount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nbPurchaseAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nbPurchaseAccount").toString())); + log.log(Level.WARNING, String.format("Expected the field `nbPurchaseAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nbPurchaseAccount").toString())); } // validate the optional field paymentAccAge if (jsonObj.get("paymentAccAge") != null && !jsonObj.get("paymentAccAge").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAccAge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccAge").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAccAge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccAge").toString())); } // ensure the field paymentAccInd can be parsed to an enum value if (jsonObj.get("paymentAccInd") != null) { @@ -991,11 +997,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field provisionAttemptsDay if (jsonObj.get("provisionAttemptsDay") != null && !jsonObj.get("provisionAttemptsDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `provisionAttemptsDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provisionAttemptsDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `provisionAttemptsDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provisionAttemptsDay").toString())); } // validate the optional field shipAddressUsage if (jsonObj.get("shipAddressUsage") != null && !jsonObj.get("shipAddressUsage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shipAddressUsage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipAddressUsage").toString())); + log.log(Level.WARNING, String.format("Expected the field `shipAddressUsage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipAddressUsage").toString())); } // ensure the field shipAddressUsageInd can be parsed to an enum value if (jsonObj.get("shipAddressUsageInd") != null) { @@ -1020,11 +1026,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field txnActivityDay if (jsonObj.get("txnActivityDay") != null && !jsonObj.get("txnActivityDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txnActivityDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `txnActivityDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityDay").toString())); } // validate the optional field txnActivityYear if (jsonObj.get("txnActivityYear") != null && !jsonObj.get("txnActivityYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `txnActivityYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `txnActivityYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("txnActivityYear").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java index 4bd329888..404ee51b7 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -326,6 +328,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalData3DSecure.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -346,12 +352,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalData3DSecure.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalData3DSecure` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalData3DSecure` properties.", entry.getKey())); } } // validate the optional field allow3DS2 if (jsonObj.get("allow3DS2") != null && !jsonObj.get("allow3DS2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `allow3DS2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allow3DS2").toString())); + log.log(Level.WARNING, String.format("Expected the field `allow3DS2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allow3DS2").toString())); } // ensure the field challengeWindowSize can be parsed to an enum value if (jsonObj.get("challengeWindowSize") != null) { @@ -362,19 +368,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field executeThreeD if (jsonObj.get("executeThreeD") != null && !jsonObj.get("executeThreeD").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `executeThreeD` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executeThreeD").toString())); + log.log(Level.WARNING, String.format("Expected the field `executeThreeD` to be a primitive type in the JSON string but got `%s`", jsonObj.get("executeThreeD").toString())); } // validate the optional field mpiImplementationType if (jsonObj.get("mpiImplementationType") != null && !jsonObj.get("mpiImplementationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mpiImplementationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mpiImplementationType").toString())); + log.log(Level.WARNING, String.format("Expected the field `mpiImplementationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mpiImplementationType").toString())); } // validate the optional field scaExemption if (jsonObj.get("scaExemption") != null && !jsonObj.get("scaExemption").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scaExemption` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemption").toString())); + log.log(Level.WARNING, String.format("Expected the field `scaExemption` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemption").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java index e4abdb2e5..94de1e4d1 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -171,10 +173,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; @@ -193,10 +195,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; @@ -215,10 +217,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; @@ -237,10 +239,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; @@ -259,10 +261,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; @@ -281,10 +283,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; @@ -303,10 +305,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; @@ -325,10 +327,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; @@ -347,10 +349,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; @@ -369,10 +371,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; @@ -391,10 +393,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; @@ -413,10 +415,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; @@ -435,10 +437,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; @@ -457,10 +459,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; @@ -479,10 +481,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; @@ -501,10 +503,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; @@ -523,10 +525,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; @@ -545,10 +547,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; @@ -567,10 +569,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; @@ -589,10 +591,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; @@ -611,10 +613,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; @@ -633,10 +635,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; @@ -655,10 +657,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; @@ -677,10 +679,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; @@ -699,10 +701,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; @@ -721,10 +723,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; @@ -743,10 +745,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; @@ -765,10 +767,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; @@ -912,6 +914,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("airline.passenger_name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataAirline.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -932,7 +938,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataAirline.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataAirline` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataAirline` properties.", entry.getKey())); } } @@ -944,115 +950,115 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field airline.agency_invoice_number if (jsonObj.get("airline.agency_invoice_number") != null && !jsonObj.get("airline.agency_invoice_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.agency_invoice_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_invoice_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.agency_invoice_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_invoice_number").toString())); } // validate the optional field airline.agency_plan_name if (jsonObj.get("airline.agency_plan_name") != null && !jsonObj.get("airline.agency_plan_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.agency_plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_plan_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.agency_plan_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.agency_plan_name").toString())); } // validate the optional field airline.airline_code if (jsonObj.get("airline.airline_code") != null && !jsonObj.get("airline.airline_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.airline_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.airline_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_code").toString())); } // validate the optional field airline.airline_designator_code if (jsonObj.get("airline.airline_designator_code") != null && !jsonObj.get("airline.airline_designator_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.airline_designator_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_designator_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.airline_designator_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.airline_designator_code").toString())); } // validate the optional field airline.boarding_fee if (jsonObj.get("airline.boarding_fee") != null && !jsonObj.get("airline.boarding_fee").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.boarding_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.boarding_fee").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.boarding_fee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.boarding_fee").toString())); } // validate the optional field airline.computerized_reservation_system if (jsonObj.get("airline.computerized_reservation_system") != null && !jsonObj.get("airline.computerized_reservation_system").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.computerized_reservation_system` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.computerized_reservation_system").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.computerized_reservation_system` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.computerized_reservation_system").toString())); } // validate the optional field airline.customer_reference_number if (jsonObj.get("airline.customer_reference_number") != null && !jsonObj.get("airline.customer_reference_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.customer_reference_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.customer_reference_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.customer_reference_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.customer_reference_number").toString())); } // validate the optional field airline.document_type if (jsonObj.get("airline.document_type") != null && !jsonObj.get("airline.document_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.document_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.document_type").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.document_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.document_type").toString())); } // validate the optional field airline.flight_date if (jsonObj.get("airline.flight_date") != null && !jsonObj.get("airline.flight_date").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.flight_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.flight_date").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.flight_date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.flight_date").toString())); } // validate the optional field airline.leg.carrier_code if (jsonObj.get("airline.leg.carrier_code") != null && !jsonObj.get("airline.leg.carrier_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.carrier_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.carrier_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.carrier_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.carrier_code").toString())); } // validate the optional field airline.leg.class_of_travel if (jsonObj.get("airline.leg.class_of_travel") != null && !jsonObj.get("airline.leg.class_of_travel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.class_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.class_of_travel").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.class_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.class_of_travel").toString())); } // validate the optional field airline.leg.date_of_travel if (jsonObj.get("airline.leg.date_of_travel") != null && !jsonObj.get("airline.leg.date_of_travel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.date_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.date_of_travel").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.date_of_travel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.date_of_travel").toString())); } // validate the optional field airline.leg.depart_airport if (jsonObj.get("airline.leg.depart_airport") != null && !jsonObj.get("airline.leg.depart_airport").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.depart_airport` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_airport").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.depart_airport` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_airport").toString())); } // validate the optional field airline.leg.depart_tax if (jsonObj.get("airline.leg.depart_tax") != null && !jsonObj.get("airline.leg.depart_tax").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.depart_tax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_tax").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.depart_tax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.depart_tax").toString())); } // validate the optional field airline.leg.destination_code if (jsonObj.get("airline.leg.destination_code") != null && !jsonObj.get("airline.leg.destination_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.destination_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.destination_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.destination_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.destination_code").toString())); } // validate the optional field airline.leg.fare_base_code if (jsonObj.get("airline.leg.fare_base_code") != null && !jsonObj.get("airline.leg.fare_base_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.fare_base_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.fare_base_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.fare_base_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.fare_base_code").toString())); } // validate the optional field airline.leg.flight_number if (jsonObj.get("airline.leg.flight_number") != null && !jsonObj.get("airline.leg.flight_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.flight_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.flight_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.flight_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.flight_number").toString())); } // validate the optional field airline.leg.stop_over_code if (jsonObj.get("airline.leg.stop_over_code") != null && !jsonObj.get("airline.leg.stop_over_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.leg.stop_over_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.stop_over_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.leg.stop_over_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.leg.stop_over_code").toString())); } // validate the optional field airline.passenger.date_of_birth if (jsonObj.get("airline.passenger.date_of_birth") != null && !jsonObj.get("airline.passenger.date_of_birth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.date_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.date_of_birth").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.date_of_birth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.date_of_birth").toString())); } // validate the optional field airline.passenger.first_name if (jsonObj.get("airline.passenger.first_name") != null && !jsonObj.get("airline.passenger.first_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.first_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.first_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.first_name").toString())); } // validate the optional field airline.passenger.last_name if (jsonObj.get("airline.passenger.last_name") != null && !jsonObj.get("airline.passenger.last_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.last_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.last_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.last_name").toString())); } // validate the optional field airline.passenger.telephone_number if (jsonObj.get("airline.passenger.telephone_number") != null && !jsonObj.get("airline.passenger.telephone_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.telephone_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.telephone_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.telephone_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.telephone_number").toString())); } // validate the optional field airline.passenger.traveller_type if (jsonObj.get("airline.passenger.traveller_type") != null && !jsonObj.get("airline.passenger.traveller_type").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger.traveller_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.traveller_type").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger.traveller_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger.traveller_type").toString())); } // validate the optional field airline.passenger_name if (jsonObj.get("airline.passenger_name") != null && !jsonObj.get("airline.passenger_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.passenger_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.passenger_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.passenger_name").toString())); } // validate the optional field airline.ticket_issue_address if (jsonObj.get("airline.ticket_issue_address") != null && !jsonObj.get("airline.ticket_issue_address").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.ticket_issue_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_issue_address").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.ticket_issue_address` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_issue_address").toString())); } // validate the optional field airline.ticket_number if (jsonObj.get("airline.ticket_number") != null && !jsonObj.get("airline.ticket_number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.ticket_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_number").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.ticket_number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.ticket_number").toString())); } // validate the optional field airline.travel_agency_code if (jsonObj.get("airline.travel_agency_code") != null && !jsonObj.get("airline.travel_agency_code").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.travel_agency_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_code").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.travel_agency_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_code").toString())); } // validate the optional field airline.travel_agency_name if (jsonObj.get("airline.travel_agency_name") != null && !jsonObj.get("airline.travel_agency_name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `airline.travel_agency_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_name").toString())); + log.log(Level.WARNING, String.format("Expected the field `airline.travel_agency_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("airline.travel_agency_name").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java index c4032aa14..23523f872 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -151,10 +153,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; @@ -173,10 +175,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; @@ -195,10 +197,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; @@ -217,10 +219,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; @@ -239,10 +241,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; @@ -261,10 +263,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; @@ -283,10 +285,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; @@ -305,10 +307,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; @@ -327,10 +329,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; @@ -349,10 +351,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; @@ -371,10 +373,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; @@ -393,10 +395,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; @@ -415,10 +417,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; @@ -437,10 +439,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; @@ -459,10 +461,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; @@ -481,10 +483,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; @@ -503,10 +505,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; @@ -525,10 +527,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; @@ -547,10 +549,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; @@ -569,10 +571,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; @@ -591,10 +593,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; @@ -613,10 +615,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; @@ -635,10 +637,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; @@ -766,6 +768,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataCarRental.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -786,100 +792,100 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataCarRental.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCarRental` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCarRental` properties.", entry.getKey())); } } // validate the optional field carRental.checkOutDate if (jsonObj.get("carRental.checkOutDate") != null && !jsonObj.get("carRental.checkOutDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.checkOutDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.checkOutDate").toString())); } // validate the optional field carRental.customerServiceTollFreeNumber if (jsonObj.get("carRental.customerServiceTollFreeNumber") != null && !jsonObj.get("carRental.customerServiceTollFreeNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.customerServiceTollFreeNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.customerServiceTollFreeNumber").toString())); } // validate the optional field carRental.daysRented if (jsonObj.get("carRental.daysRented") != null && !jsonObj.get("carRental.daysRented").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.daysRented` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.daysRented").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.daysRented` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.daysRented").toString())); } // validate the optional field carRental.fuelCharges if (jsonObj.get("carRental.fuelCharges") != null && !jsonObj.get("carRental.fuelCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.fuelCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.fuelCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.fuelCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.fuelCharges").toString())); } // validate the optional field carRental.insuranceCharges if (jsonObj.get("carRental.insuranceCharges") != null && !jsonObj.get("carRental.insuranceCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.insuranceCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.insuranceCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.insuranceCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.insuranceCharges").toString())); } // validate the optional field carRental.locationCity if (jsonObj.get("carRental.locationCity") != null && !jsonObj.get("carRental.locationCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.locationCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.locationCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCity").toString())); } // validate the optional field carRental.locationCountry if (jsonObj.get("carRental.locationCountry") != null && !jsonObj.get("carRental.locationCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.locationCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.locationCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationCountry").toString())); } // validate the optional field carRental.locationStateProvince if (jsonObj.get("carRental.locationStateProvince") != null && !jsonObj.get("carRental.locationStateProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.locationStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationStateProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.locationStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.locationStateProvince").toString())); } // validate the optional field carRental.noShowIndicator if (jsonObj.get("carRental.noShowIndicator") != null && !jsonObj.get("carRental.noShowIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.noShowIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.noShowIndicator").toString())); } // validate the optional field carRental.oneWayDropOffCharges if (jsonObj.get("carRental.oneWayDropOffCharges") != null && !jsonObj.get("carRental.oneWayDropOffCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.oneWayDropOffCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.oneWayDropOffCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.oneWayDropOffCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.oneWayDropOffCharges").toString())); } // validate the optional field carRental.rate if (jsonObj.get("carRental.rate") != null && !jsonObj.get("carRental.rate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rate").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rate").toString())); } // validate the optional field carRental.rateIndicator if (jsonObj.get("carRental.rateIndicator") != null && !jsonObj.get("carRental.rateIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rateIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rateIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rateIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rateIndicator").toString())); } // validate the optional field carRental.rentalAgreementNumber if (jsonObj.get("carRental.rentalAgreementNumber") != null && !jsonObj.get("carRental.rentalAgreementNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rentalAgreementNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalAgreementNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rentalAgreementNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalAgreementNumber").toString())); } // validate the optional field carRental.rentalClassId if (jsonObj.get("carRental.rentalClassId") != null && !jsonObj.get("carRental.rentalClassId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.rentalClassId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalClassId").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.rentalClassId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.rentalClassId").toString())); } // validate the optional field carRental.renterName if (jsonObj.get("carRental.renterName") != null && !jsonObj.get("carRental.renterName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.renterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.renterName").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.renterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.renterName").toString())); } // validate the optional field carRental.returnCity if (jsonObj.get("carRental.returnCity") != null && !jsonObj.get("carRental.returnCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCity").toString())); } // validate the optional field carRental.returnCountry if (jsonObj.get("carRental.returnCountry") != null && !jsonObj.get("carRental.returnCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnCountry").toString())); } // validate the optional field carRental.returnDate if (jsonObj.get("carRental.returnDate") != null && !jsonObj.get("carRental.returnDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnDate").toString())); } // validate the optional field carRental.returnLocationId if (jsonObj.get("carRental.returnLocationId") != null && !jsonObj.get("carRental.returnLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnLocationId").toString())); } // validate the optional field carRental.returnStateProvince if (jsonObj.get("carRental.returnStateProvince") != null && !jsonObj.get("carRental.returnStateProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.returnStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnStateProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.returnStateProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.returnStateProvince").toString())); } // validate the optional field carRental.taxExemptIndicator if (jsonObj.get("carRental.taxExemptIndicator") != null && !jsonObj.get("carRental.taxExemptIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `carRental.taxExemptIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.taxExemptIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `carRental.taxExemptIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carRental.taxExemptIndicator").toString())); } // validate the optional field travelEntertainmentAuthData.duration if (jsonObj.get("travelEntertainmentAuthData.duration") != null && !jsonObj.get("travelEntertainmentAuthData.duration").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); } // validate the optional field travelEntertainmentAuthData.market if (jsonObj.get("travelEntertainmentAuthData.market") != null && !jsonObj.get("travelEntertainmentAuthData.market").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java index 66c95e3ec..d61c38dcc 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -610,6 +612,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataCommon.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -630,24 +636,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataCommon.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCommon` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataCommon` properties.", entry.getKey())); } } // validate the optional field RequestedTestErrorResponseCode if (jsonObj.get("RequestedTestErrorResponseCode") != null && !jsonObj.get("RequestedTestErrorResponseCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `RequestedTestErrorResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestedTestErrorResponseCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `RequestedTestErrorResponseCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestedTestErrorResponseCode").toString())); } // validate the optional field allowPartialAuth if (jsonObj.get("allowPartialAuth") != null && !jsonObj.get("allowPartialAuth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `allowPartialAuth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allowPartialAuth").toString())); + log.log(Level.WARNING, String.format("Expected the field `allowPartialAuth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("allowPartialAuth").toString())); } // validate the optional field authorisationType if (jsonObj.get("authorisationType") != null && !jsonObj.get("authorisationType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationType").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationType").toString())); } // validate the optional field customRoutingFlag if (jsonObj.get("customRoutingFlag") != null && !jsonObj.get("customRoutingFlag").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `customRoutingFlag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customRoutingFlag").toString())); + log.log(Level.WARNING, String.format("Expected the field `customRoutingFlag` to be a primitive type in the JSON string but got `%s`", jsonObj.get("customRoutingFlag").toString())); } // ensure the field industryUsage can be parsed to an enum value if (jsonObj.get("industryUsage") != null) { @@ -658,47 +664,47 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field manualCapture if (jsonObj.get("manualCapture") != null && !jsonObj.get("manualCapture").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `manualCapture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manualCapture").toString())); + log.log(Level.WARNING, String.format("Expected the field `manualCapture` to be a primitive type in the JSON string but got `%s`", jsonObj.get("manualCapture").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field overwriteBrand if (jsonObj.get("overwriteBrand") != null && !jsonObj.get("overwriteBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `overwriteBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("overwriteBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `overwriteBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("overwriteBrand").toString())); } // validate the optional field subMerchantCity if (jsonObj.get("subMerchantCity") != null && !jsonObj.get("subMerchantCity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCity").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCity").toString())); } // validate the optional field subMerchantCountry if (jsonObj.get("subMerchantCountry") != null && !jsonObj.get("subMerchantCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantCountry").toString())); } // validate the optional field subMerchantID if (jsonObj.get("subMerchantID") != null && !jsonObj.get("subMerchantID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantID").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantID").toString())); } // validate the optional field subMerchantName if (jsonObj.get("subMerchantName") != null && !jsonObj.get("subMerchantName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantName").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantName").toString())); } // validate the optional field subMerchantPostalCode if (jsonObj.get("subMerchantPostalCode") != null && !jsonObj.get("subMerchantPostalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantPostalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantPostalCode").toString())); } // validate the optional field subMerchantState if (jsonObj.get("subMerchantState") != null && !jsonObj.get("subMerchantState").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantState").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantState` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantState").toString())); } // validate the optional field subMerchantStreet if (jsonObj.get("subMerchantStreet") != null && !jsonObj.get("subMerchantStreet").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantStreet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantStreet").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantStreet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantStreet").toString())); } // validate the optional field subMerchantTaxId if (jsonObj.get("subMerchantTaxId") != null && !jsonObj.get("subMerchantTaxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchantTaxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantTaxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchantTaxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchantTaxId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java index fd959ea2f..82938e624 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -127,10 +129,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; @@ -149,10 +151,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; @@ -171,10 +173,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; @@ -193,10 +195,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; @@ -215,10 +217,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; @@ -237,10 +239,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; @@ -259,10 +261,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; @@ -281,10 +283,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; @@ -303,10 +305,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; @@ -325,10 +327,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; @@ -347,10 +349,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; @@ -369,10 +371,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; @@ -391,10 +393,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; @@ -413,10 +415,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; @@ -435,10 +437,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; @@ -457,10 +459,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; @@ -479,10 +481,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; @@ -592,6 +594,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataLevel23.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -612,76 +618,76 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataLevel23.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLevel23` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLevel23` properties.", entry.getKey())); } } // validate the optional field enhancedSchemeData.customerReference if (jsonObj.get("enhancedSchemeData.customerReference") != null && !jsonObj.get("enhancedSchemeData.customerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); } // validate the optional field enhancedSchemeData.destinationCountryCode if (jsonObj.get("enhancedSchemeData.destinationCountryCode") != null && !jsonObj.get("enhancedSchemeData.destinationCountryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.destinationCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationCountryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.destinationCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationCountryCode").toString())); } // validate the optional field enhancedSchemeData.destinationPostalCode if (jsonObj.get("enhancedSchemeData.destinationPostalCode") != null && !jsonObj.get("enhancedSchemeData.destinationPostalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.destinationPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationPostalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.destinationPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationPostalCode").toString())); } // validate the optional field enhancedSchemeData.destinationStateProvinceCode if (jsonObj.get("enhancedSchemeData.destinationStateProvinceCode") != null && !jsonObj.get("enhancedSchemeData.destinationStateProvinceCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.destinationStateProvinceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationStateProvinceCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.destinationStateProvinceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.destinationStateProvinceCode").toString())); } // validate the optional field enhancedSchemeData.dutyAmount if (jsonObj.get("enhancedSchemeData.dutyAmount") != null && !jsonObj.get("enhancedSchemeData.dutyAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.dutyAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.dutyAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.dutyAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.dutyAmount").toString())); } // validate the optional field enhancedSchemeData.freightAmount if (jsonObj.get("enhancedSchemeData.freightAmount") != null && !jsonObj.get("enhancedSchemeData.freightAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.freightAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.freightAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.freightAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.freightAmount").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].commodityCode if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].commodityCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].commodityCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].commodityCode").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].description if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].description").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].discountAmount if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].discountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].discountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].discountAmount").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].productCode if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].productCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].productCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].productCode").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].quantity if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].quantity").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].totalAmount if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].totalAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].totalAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].totalAmount").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure").toString())); } // validate the optional field enhancedSchemeData.itemDetailLine[itemNr].unitPrice if (jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice") != null && !jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.itemDetailLine[itemNr].unitPrice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.itemDetailLine[itemNr].unitPrice").toString())); } // validate the optional field enhancedSchemeData.orderDate if (jsonObj.get("enhancedSchemeData.orderDate") != null && !jsonObj.get("enhancedSchemeData.orderDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.orderDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.orderDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.orderDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.orderDate").toString())); } // validate the optional field enhancedSchemeData.shipFromPostalCode if (jsonObj.get("enhancedSchemeData.shipFromPostalCode") != null && !jsonObj.get("enhancedSchemeData.shipFromPostalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.shipFromPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.shipFromPostalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.shipFromPostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.shipFromPostalCode").toString())); } // validate the optional field enhancedSchemeData.totalTaxAmount if (jsonObj.get("enhancedSchemeData.totalTaxAmount") != null && !jsonObj.get("enhancedSchemeData.totalTaxAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java index b8e971107..924eb150e 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -97,10 +99,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; @@ -171,10 +169,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; @@ -193,10 +191,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; @@ -215,10 +213,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; @@ -237,10 +235,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; @@ -259,10 +257,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; @@ -281,10 +279,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; @@ -303,10 +301,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; @@ -325,10 +323,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; @@ -347,10 +345,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; @@ -369,10 +367,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; @@ -384,28 +382,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; @@ -413,10 +389,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; @@ -435,10 +411,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; @@ -457,10 +433,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; @@ -479,10 +455,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; @@ -516,7 +492,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) && @@ -525,7 +500,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 @@ -544,7 +519,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"); @@ -583,7 +557,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"); @@ -592,6 +565,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataLodging.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -612,76 +589,72 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataLodging.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLodging` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataLodging` properties.", entry.getKey())); } } // validate the optional field lodging.checkInDate if (jsonObj.get("lodging.checkInDate") != null && !jsonObj.get("lodging.checkInDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.checkInDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkInDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.checkInDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkInDate").toString())); } // validate the optional field lodging.checkOutDate if (jsonObj.get("lodging.checkOutDate") != null && !jsonObj.get("lodging.checkOutDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkOutDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.checkOutDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.checkOutDate").toString())); } // validate the optional field lodging.customerServiceTollFreeNumber if (jsonObj.get("lodging.customerServiceTollFreeNumber") != null && !jsonObj.get("lodging.customerServiceTollFreeNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.customerServiceTollFreeNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.customerServiceTollFreeNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.customerServiceTollFreeNumber").toString())); } // validate the optional field lodging.fireSafetyActIndicator if (jsonObj.get("lodging.fireSafetyActIndicator") != null && !jsonObj.get("lodging.fireSafetyActIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.fireSafetyActIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.fireSafetyActIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.fireSafetyActIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.fireSafetyActIndicator").toString())); } // validate the optional field lodging.folioCashAdvances if (jsonObj.get("lodging.folioCashAdvances") != null && !jsonObj.get("lodging.folioCashAdvances").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.folioCashAdvances` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioCashAdvances").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.folioCashAdvances` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioCashAdvances").toString())); } // validate the optional field lodging.folioNumber if (jsonObj.get("lodging.folioNumber") != null && !jsonObj.get("lodging.folioNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.folioNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.folioNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.folioNumber").toString())); } // validate the optional field lodging.foodBeverageCharges if (jsonObj.get("lodging.foodBeverageCharges") != null && !jsonObj.get("lodging.foodBeverageCharges").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.foodBeverageCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.foodBeverageCharges").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.foodBeverageCharges` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.foodBeverageCharges").toString())); } // validate the optional field lodging.noShowIndicator if (jsonObj.get("lodging.noShowIndicator") != null && !jsonObj.get("lodging.noShowIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.noShowIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.noShowIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.noShowIndicator").toString())); } // validate the optional field lodging.prepaidExpenses if (jsonObj.get("lodging.prepaidExpenses") != null && !jsonObj.get("lodging.prepaidExpenses").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.prepaidExpenses` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.prepaidExpenses").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.prepaidExpenses` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.prepaidExpenses").toString())); } // validate the optional field lodging.propertyPhoneNumber if (jsonObj.get("lodging.propertyPhoneNumber") != null && !jsonObj.get("lodging.propertyPhoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.propertyPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.propertyPhoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.propertyPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.propertyPhoneNumber").toString())); } // validate the optional field lodging.room1.numberOfNights if (jsonObj.get("lodging.room1.numberOfNights") != null && !jsonObj.get("lodging.room1.numberOfNights").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.room1.numberOfNights` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.room1.numberOfNights").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.room1.numberOfNights` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.room1.numberOfNights").toString())); } // validate the optional field lodging.room1.rate 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())); + log.log(Level.WARNING, 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.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())); + log.log(Level.WARNING, String.format("Expected the field `lodging.totalRoomTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalRoomTax").toString())); } // validate the optional field lodging.totalTax if (jsonObj.get("lodging.totalTax") != null && !jsonObj.get("lodging.totalTax").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lodging.totalTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalTax").toString())); + log.log(Level.WARNING, String.format("Expected the field `lodging.totalTax` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lodging.totalTax").toString())); } // validate the optional field travelEntertainmentAuthData.duration if (jsonObj.get("travelEntertainmentAuthData.duration") != null && !jsonObj.get("travelEntertainmentAuthData.duration").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.duration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.duration").toString())); } // validate the optional field travelEntertainmentAuthData.market if (jsonObj.get("travelEntertainmentAuthData.market") != null && !jsonObj.get("travelEntertainmentAuthData.market").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); + log.log(Level.WARNING, String.format("Expected the field `travelEntertainmentAuthData.market` to be a primitive type in the JSON string but got `%s`", jsonObj.get("travelEntertainmentAuthData.market").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java index 66330ccde..a0079c1f0 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataModifications.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,12 +154,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataModifications.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataModifications` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataModifications` properties.", entry.getKey())); } } // validate the optional field installmentPaymentData.selectedInstallmentOption if (jsonObj.get("installmentPaymentData.selectedInstallmentOption") != null && !jsonObj.get("installmentPaymentData.selectedInstallmentOption").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.selectedInstallmentOption` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.selectedInstallmentOption").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.selectedInstallmentOption` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.selectedInstallmentOption").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java index fa5107f18..9d3e69781 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -621,6 +623,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataOpenInvoice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -641,80 +647,80 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataOpenInvoice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpenInvoice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpenInvoice` properties.", entry.getKey())); } } // validate the optional field openinvoicedata.merchantData if (jsonObj.get("openinvoicedata.merchantData") != null && !jsonObj.get("openinvoicedata.merchantData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.merchantData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.merchantData").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.merchantData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.merchantData").toString())); } // validate the optional field openinvoicedata.numberOfLines if (jsonObj.get("openinvoicedata.numberOfLines") != null && !jsonObj.get("openinvoicedata.numberOfLines").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.numberOfLines` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.numberOfLines").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.numberOfLines` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.numberOfLines").toString())); } // validate the optional field openinvoicedata.recipientFirstName if (jsonObj.get("openinvoicedata.recipientFirstName") != null && !jsonObj.get("openinvoicedata.recipientFirstName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.recipientFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientFirstName").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.recipientFirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientFirstName").toString())); } // validate the optional field openinvoicedata.recipientLastName if (jsonObj.get("openinvoicedata.recipientLastName") != null && !jsonObj.get("openinvoicedata.recipientLastName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedata.recipientLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientLastName").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedata.recipientLastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedata.recipientLastName").toString())); } // validate the optional field openinvoicedataLine[itemNr].currencyCode if (jsonObj.get("openinvoicedataLine[itemNr].currencyCode") != null && !jsonObj.get("openinvoicedataLine[itemNr].currencyCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].currencyCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].currencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].currencyCode").toString())); } // validate the optional field openinvoicedataLine[itemNr].description if (jsonObj.get("openinvoicedataLine[itemNr].description") != null && !jsonObj.get("openinvoicedataLine[itemNr].description").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].description").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].description").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemAmount if (jsonObj.get("openinvoicedataLine[itemNr].itemAmount") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemAmount").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemId if (jsonObj.get("openinvoicedataLine[itemNr].itemId") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemId").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemId").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemVatAmount if (jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemVatAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemVatAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatAmount").toString())); } // validate the optional field openinvoicedataLine[itemNr].itemVatPercentage if (jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage") != null && !jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].itemVatPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].itemVatPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].itemVatPercentage").toString())); } // validate the optional field openinvoicedataLine[itemNr].numberOfItems if (jsonObj.get("openinvoicedataLine[itemNr].numberOfItems") != null && !jsonObj.get("openinvoicedataLine[itemNr].numberOfItems").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].numberOfItems` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].numberOfItems").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].numberOfItems` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].numberOfItems").toString())); } // validate the optional field openinvoicedataLine[itemNr].returnShippingCompany if (jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany") != null && !jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].returnShippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].returnShippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnShippingCompany").toString())); } // validate the optional field openinvoicedataLine[itemNr].returnTrackingNumber if (jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber") != null && !jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingNumber").toString())); } // validate the optional field openinvoicedataLine[itemNr].returnTrackingUri if (jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri") != null && !jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].returnTrackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].returnTrackingUri").toString())); } // validate the optional field openinvoicedataLine[itemNr].shippingCompany if (jsonObj.get("openinvoicedataLine[itemNr].shippingCompany") != null && !jsonObj.get("openinvoicedataLine[itemNr].shippingCompany").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].shippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingCompany").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].shippingCompany` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingCompany").toString())); } // validate the optional field openinvoicedataLine[itemNr].shippingMethod if (jsonObj.get("openinvoicedataLine[itemNr].shippingMethod") != null && !jsonObj.get("openinvoicedataLine[itemNr].shippingMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].shippingMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].shippingMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].shippingMethod").toString())); } // validate the optional field openinvoicedataLine[itemNr].trackingNumber if (jsonObj.get("openinvoicedataLine[itemNr].trackingNumber") != null && !jsonObj.get("openinvoicedataLine[itemNr].trackingNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].trackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].trackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingNumber").toString())); } // validate the optional field openinvoicedataLine[itemNr].trackingUri if (jsonObj.get("openinvoicedataLine[itemNr].trackingUri") != null && !jsonObj.get("openinvoicedataLine[itemNr].trackingUri").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `openinvoicedataLine[itemNr].trackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingUri").toString())); + log.log(Level.WARNING, String.format("Expected the field `openinvoicedataLine[itemNr].trackingUri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("openinvoicedataLine[itemNr].trackingUri").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java index 22ff30d88..4dcb7225b 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataOpi.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,12 +154,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataOpi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataOpi` properties.", entry.getKey())); } } // validate the optional field opi.includeTransToken if (jsonObj.get("opi.includeTransToken") != null && !jsonObj.get("opi.includeTransToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `opi.includeTransToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.includeTransToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `opi.includeTransToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.includeTransToken").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java index ed66fb835..74514b021 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -331,6 +333,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRatepay.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -351,40 +357,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRatepay.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRatepay` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRatepay` properties.", entry.getKey())); } } // validate the optional field ratepay.installmentAmount if (jsonObj.get("ratepay.installmentAmount") != null && !jsonObj.get("ratepay.installmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.installmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.installmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.installmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.installmentAmount").toString())); } // validate the optional field ratepay.interestRate if (jsonObj.get("ratepay.interestRate") != null && !jsonObj.get("ratepay.interestRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.interestRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.interestRate").toString())); } // validate the optional field ratepay.lastInstallmentAmount if (jsonObj.get("ratepay.lastInstallmentAmount") != null && !jsonObj.get("ratepay.lastInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.lastInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.lastInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.lastInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.lastInstallmentAmount").toString())); } // validate the optional field ratepay.paymentFirstday if (jsonObj.get("ratepay.paymentFirstday") != null && !jsonObj.get("ratepay.paymentFirstday").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepay.paymentFirstday` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.paymentFirstday").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepay.paymentFirstday` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepay.paymentFirstday").toString())); } // validate the optional field ratepaydata.deliveryDate if (jsonObj.get("ratepaydata.deliveryDate") != null && !jsonObj.get("ratepaydata.deliveryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.deliveryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.deliveryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.deliveryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.deliveryDate").toString())); } // validate the optional field ratepaydata.dueDate if (jsonObj.get("ratepaydata.dueDate") != null && !jsonObj.get("ratepaydata.dueDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.dueDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.dueDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.dueDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.dueDate").toString())); } // validate the optional field ratepaydata.invoiceDate if (jsonObj.get("ratepaydata.invoiceDate") != null && !jsonObj.get("ratepaydata.invoiceDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.invoiceDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.invoiceDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceDate").toString())); } // validate the optional field ratepaydata.invoiceId if (jsonObj.get("ratepaydata.invoiceId") != null && !jsonObj.get("ratepaydata.invoiceId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ratepaydata.invoiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceId").toString())); + log.log(Level.WARNING, String.format("Expected the field `ratepaydata.invoiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ratepaydata.invoiceId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java index fe4588349..665122b24 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRetry.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRetry.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRetry` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRetry` properties.", entry.getKey())); } } // validate the optional field retry.chainAttemptNumber if (jsonObj.get("retry.chainAttemptNumber") != null && !jsonObj.get("retry.chainAttemptNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retry.chainAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.chainAttemptNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `retry.chainAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.chainAttemptNumber").toString())); } // validate the optional field retry.orderAttemptNumber if (jsonObj.get("retry.orderAttemptNumber") != null && !jsonObj.get("retry.orderAttemptNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retry.orderAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.orderAttemptNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `retry.orderAttemptNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.orderAttemptNumber").toString())); } // validate the optional field retry.skipRetry if (jsonObj.get("retry.skipRetry") != null && !jsonObj.get("retry.skipRetry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `retry.skipRetry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.skipRetry").toString())); + log.log(Level.WARNING, String.format("Expected the field `retry.skipRetry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("retry.skipRetry").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java index ff5785c0e..b1c8fb1cc 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -708,6 +710,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRisk.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -728,92 +734,92 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRisk.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRisk` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRisk` properties.", entry.getKey())); } } // validate the optional field riskdata.[customFieldName] if (jsonObj.get("riskdata.[customFieldName]") != null && !jsonObj.get("riskdata.[customFieldName]").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.[customFieldName]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.[customFieldName]").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.[customFieldName]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.[customFieldName]").toString())); } // validate the optional field riskdata.basket.item[itemNr].amountPerItem if (jsonObj.get("riskdata.basket.item[itemNr].amountPerItem") != null && !jsonObj.get("riskdata.basket.item[itemNr].amountPerItem").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].amountPerItem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].amountPerItem").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].amountPerItem` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].amountPerItem").toString())); } // validate the optional field riskdata.basket.item[itemNr].brand if (jsonObj.get("riskdata.basket.item[itemNr].brand") != null && !jsonObj.get("riskdata.basket.item[itemNr].brand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].brand").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].brand").toString())); } // validate the optional field riskdata.basket.item[itemNr].category if (jsonObj.get("riskdata.basket.item[itemNr].category") != null && !jsonObj.get("riskdata.basket.item[itemNr].category").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].category").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].category").toString())); } // validate the optional field riskdata.basket.item[itemNr].color if (jsonObj.get("riskdata.basket.item[itemNr].color") != null && !jsonObj.get("riskdata.basket.item[itemNr].color").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].color").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].color` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].color").toString())); } // validate the optional field riskdata.basket.item[itemNr].currency if (jsonObj.get("riskdata.basket.item[itemNr].currency") != null && !jsonObj.get("riskdata.basket.item[itemNr].currency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].currency").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].currency").toString())); } // validate the optional field riskdata.basket.item[itemNr].itemID if (jsonObj.get("riskdata.basket.item[itemNr].itemID") != null && !jsonObj.get("riskdata.basket.item[itemNr].itemID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].itemID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].itemID").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].itemID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].itemID").toString())); } // validate the optional field riskdata.basket.item[itemNr].manufacturer if (jsonObj.get("riskdata.basket.item[itemNr].manufacturer") != null && !jsonObj.get("riskdata.basket.item[itemNr].manufacturer").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].manufacturer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].manufacturer").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].manufacturer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].manufacturer").toString())); } // validate the optional field riskdata.basket.item[itemNr].productTitle if (jsonObj.get("riskdata.basket.item[itemNr].productTitle") != null && !jsonObj.get("riskdata.basket.item[itemNr].productTitle").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].productTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].productTitle").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].productTitle` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].productTitle").toString())); } // validate the optional field riskdata.basket.item[itemNr].quantity if (jsonObj.get("riskdata.basket.item[itemNr].quantity") != null && !jsonObj.get("riskdata.basket.item[itemNr].quantity").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].quantity").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].quantity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].quantity").toString())); } // validate the optional field riskdata.basket.item[itemNr].receiverEmail if (jsonObj.get("riskdata.basket.item[itemNr].receiverEmail") != null && !jsonObj.get("riskdata.basket.item[itemNr].receiverEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].receiverEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].receiverEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].receiverEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].receiverEmail").toString())); } // validate the optional field riskdata.basket.item[itemNr].size if (jsonObj.get("riskdata.basket.item[itemNr].size") != null && !jsonObj.get("riskdata.basket.item[itemNr].size").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].size").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].size` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].size").toString())); } // validate the optional field riskdata.basket.item[itemNr].sku if (jsonObj.get("riskdata.basket.item[itemNr].sku") != null && !jsonObj.get("riskdata.basket.item[itemNr].sku").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].sku").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].sku` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].sku").toString())); } // validate the optional field riskdata.basket.item[itemNr].upc if (jsonObj.get("riskdata.basket.item[itemNr].upc") != null && !jsonObj.get("riskdata.basket.item[itemNr].upc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.basket.item[itemNr].upc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].upc").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.basket.item[itemNr].upc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.basket.item[itemNr].upc").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionCode if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionCode").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionDiscountAmount if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountAmount").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionDiscountCurrency if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountCurrency").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionDiscountPercentage if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionDiscountPercentage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionDiscountPercentage").toString())); } // validate the optional field riskdata.promotions.promotion[itemNr].promotionName if (jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName") != null && !jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.promotions.promotion[itemNr].promotionName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.promotions.promotion[itemNr].promotionName").toString())); } // validate the optional field riskdata.riskProfileReference if (jsonObj.get("riskdata.riskProfileReference") != null && !jsonObj.get("riskdata.riskProfileReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.riskProfileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.riskProfileReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.riskProfileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.riskProfileReference").toString())); } // validate the optional field riskdata.skipRisk if (jsonObj.get("riskdata.skipRisk") != null && !jsonObj.get("riskdata.skipRisk").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskdata.skipRisk` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.skipRisk").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskdata.skipRisk` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskdata.skipRisk").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java index 32ac29a69..a79e6927e 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -534,6 +536,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataRiskStandalone.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -554,68 +560,68 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataRiskStandalone.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRiskStandalone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataRiskStandalone` properties.", entry.getKey())); } } // validate the optional field PayPal.CountryCode if (jsonObj.get("PayPal.CountryCode") != null && !jsonObj.get("PayPal.CountryCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.CountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.CountryCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.CountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.CountryCode").toString())); } // validate the optional field PayPal.EmailId if (jsonObj.get("PayPal.EmailId") != null && !jsonObj.get("PayPal.EmailId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.EmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.EmailId").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.EmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.EmailId").toString())); } // validate the optional field PayPal.FirstName if (jsonObj.get("PayPal.FirstName") != null && !jsonObj.get("PayPal.FirstName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.FirstName").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.FirstName").toString())); } // validate the optional field PayPal.LastName if (jsonObj.get("PayPal.LastName") != null && !jsonObj.get("PayPal.LastName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.LastName").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.LastName").toString())); } // validate the optional field PayPal.PayerId if (jsonObj.get("PayPal.PayerId") != null && !jsonObj.get("PayPal.PayerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.PayerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.PayerId").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.PayerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.PayerId").toString())); } // validate the optional field PayPal.Phone if (jsonObj.get("PayPal.Phone") != null && !jsonObj.get("PayPal.Phone").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.Phone").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.Phone").toString())); } // validate the optional field PayPal.ProtectionEligibility if (jsonObj.get("PayPal.ProtectionEligibility") != null && !jsonObj.get("PayPal.ProtectionEligibility").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.ProtectionEligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.ProtectionEligibility").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.ProtectionEligibility` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.ProtectionEligibility").toString())); } // validate the optional field PayPal.TransactionId if (jsonObj.get("PayPal.TransactionId") != null && !jsonObj.get("PayPal.TransactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `PayPal.TransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.TransactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `PayPal.TransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PayPal.TransactionId").toString())); } // validate the optional field avsResultRaw if (jsonObj.get("avsResultRaw") != null && !jsonObj.get("avsResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); } // validate the optional field bin if (jsonObj.get("bin") != null && !jsonObj.get("bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); } // validate the optional field cvcResultRaw if (jsonObj.get("cvcResultRaw") != null && !jsonObj.get("cvcResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); } // validate the optional field riskToken if (jsonObj.get("riskToken") != null && !jsonObj.get("riskToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskToken").toString())); } // validate the optional field threeDAuthenticated if (jsonObj.get("threeDAuthenticated") != null && !jsonObj.get("threeDAuthenticated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); } // validate the optional field threeDOffered if (jsonObj.get("threeDOffered") != null && !jsonObj.get("threeDOffered").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); } // validate the optional field tokenDataType if (jsonObj.get("tokenDataType") != null && !jsonObj.get("tokenDataType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenDataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenDataType").toString())); + log.log(Level.WARNING, String.format("Expected the field `tokenDataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenDataType").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java index 85c06071f..de486f74c 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -389,6 +391,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataSubMerchant.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -409,48 +415,48 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataSubMerchant.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataSubMerchant` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataSubMerchant` properties.", entry.getKey())); } } // validate the optional field subMerchant.numberOfSubSellers if (jsonObj.get("subMerchant.numberOfSubSellers") != null && !jsonObj.get("subMerchant.numberOfSubSellers").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.numberOfSubSellers` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.numberOfSubSellers").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.numberOfSubSellers` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.numberOfSubSellers").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].city if (jsonObj.get("subMerchant.subSeller[subSellerNr].city") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].city").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].city").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].city").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].country if (jsonObj.get("subMerchant.subSeller[subSellerNr].country") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].country").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].country").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].country").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].id if (jsonObj.get("subMerchant.subSeller[subSellerNr].id") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].id").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].id").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].id").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].mcc if (jsonObj.get("subMerchant.subSeller[subSellerNr].mcc") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].mcc").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].name if (jsonObj.get("subMerchant.subSeller[subSellerNr].name") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].name").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].name").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].name").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].postalCode if (jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].postalCode").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].state if (jsonObj.get("subMerchant.subSeller[subSellerNr].state") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].state").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].state").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].state").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].street if (jsonObj.get("subMerchant.subSeller[subSellerNr].street") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].street").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].street").toString())); } // validate the optional field subMerchant.subSeller[subSellerNr].taxId if (jsonObj.get("subMerchant.subSeller[subSellerNr].taxId") != null && !jsonObj.get("subMerchant.subSeller[subSellerNr].taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subMerchant.subSeller[subSellerNr].taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `subMerchant.subSeller[subSellerNr].taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subMerchant.subSeller[subSellerNr].taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java index d84df387b..addfc13ea 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -95,10 +97,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; @@ -117,10 +119,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; @@ -139,10 +141,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; @@ -161,10 +163,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; @@ -183,10 +185,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; @@ -205,10 +207,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; @@ -227,10 +229,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; @@ -249,10 +251,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; @@ -271,10 +273,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; @@ -360,6 +362,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataTemporaryServices.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -380,44 +386,44 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataTemporaryServices.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataTemporaryServices` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataTemporaryServices` properties.", entry.getKey())); } } // validate the optional field enhancedSchemeData.customerReference if (jsonObj.get("enhancedSchemeData.customerReference") != null && !jsonObj.get("enhancedSchemeData.customerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.customerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.customerReference").toString())); } // validate the optional field enhancedSchemeData.employeeName if (jsonObj.get("enhancedSchemeData.employeeName") != null && !jsonObj.get("enhancedSchemeData.employeeName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.employeeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.employeeName").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.employeeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.employeeName").toString())); } // validate the optional field enhancedSchemeData.jobDescription if (jsonObj.get("enhancedSchemeData.jobDescription") != null && !jsonObj.get("enhancedSchemeData.jobDescription").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.jobDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.jobDescription").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.jobDescription` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.jobDescription").toString())); } // validate the optional field enhancedSchemeData.regularHoursRate if (jsonObj.get("enhancedSchemeData.regularHoursRate") != null && !jsonObj.get("enhancedSchemeData.regularHoursRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.regularHoursRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.regularHoursRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursRate").toString())); } // validate the optional field enhancedSchemeData.regularHoursWorked if (jsonObj.get("enhancedSchemeData.regularHoursWorked") != null && !jsonObj.get("enhancedSchemeData.regularHoursWorked").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.regularHoursWorked` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursWorked").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.regularHoursWorked` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.regularHoursWorked").toString())); } // validate the optional field enhancedSchemeData.requestName if (jsonObj.get("enhancedSchemeData.requestName") != null && !jsonObj.get("enhancedSchemeData.requestName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.requestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.requestName").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.requestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.requestName").toString())); } // validate the optional field enhancedSchemeData.tempStartDate if (jsonObj.get("enhancedSchemeData.tempStartDate") != null && !jsonObj.get("enhancedSchemeData.tempStartDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.tempStartDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempStartDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.tempStartDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempStartDate").toString())); } // validate the optional field enhancedSchemeData.tempWeekEnding if (jsonObj.get("enhancedSchemeData.tempWeekEnding") != null && !jsonObj.get("enhancedSchemeData.tempWeekEnding").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.tempWeekEnding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempWeekEnding").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.tempWeekEnding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.tempWeekEnding").toString())); } // validate the optional field enhancedSchemeData.totalTaxAmount if (jsonObj.get("enhancedSchemeData.totalTaxAmount") != null && !jsonObj.get("enhancedSchemeData.totalTaxAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `enhancedSchemeData.totalTaxAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("enhancedSchemeData.totalTaxAmount").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java index 33284a510..5d1816abe 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalDataWallets.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,32 +299,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdditionalDataWallets.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataWallets` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalDataWallets` properties.", entry.getKey())); } } // validate the optional field androidpay.token if (jsonObj.get("androidpay.token") != null && !jsonObj.get("androidpay.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `androidpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("androidpay.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `androidpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("androidpay.token").toString())); } // validate the optional field masterpass.transactionId if (jsonObj.get("masterpass.transactionId") != null && !jsonObj.get("masterpass.transactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `masterpass.transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masterpass.transactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `masterpass.transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("masterpass.transactionId").toString())); } // validate the optional field payment.token if (jsonObj.get("payment.token") != null && !jsonObj.get("payment.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payment.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `payment.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payment.token").toString())); } // validate the optional field paywithgoogle.token if (jsonObj.get("paywithgoogle.token") != null && !jsonObj.get("paywithgoogle.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paywithgoogle.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paywithgoogle.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `paywithgoogle.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paywithgoogle.token").toString())); } // validate the optional field samsungpay.token if (jsonObj.get("samsungpay.token") != null && !jsonObj.get("samsungpay.token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `samsungpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("samsungpay.token").toString())); + log.log(Level.WARNING, String.format("Expected the field `samsungpay.token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("samsungpay.token").toString())); } // validate the optional field visacheckout.callId if (jsonObj.get("visacheckout.callId") != null && !jsonObj.get("visacheckout.callId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `visacheckout.callId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visacheckout.callId").toString())); + log.log(Level.WARNING, String.format("Expected the field `visacheckout.callId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visacheckout.callId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/Address.java b/src/main/java/com/adyen/model/payment/Address.java index 51b07ed4d..e9064fe9e 100644 --- a/src/main/java/com/adyen/model/payment/Address.java +++ b/src/main/java/com/adyen/model/payment/Address.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -278,6 +280,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("postalCode"); openapiRequiredFields.add("street"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -298,7 +304,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } @@ -310,27 +316,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 houseNumberOrName if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java index 8d4812e96..d020c2ff2 100644 --- a/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java +++ b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -445,6 +447,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("modificationAmount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdjustAuthorisationRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -465,7 +471,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AdjustAuthorisationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdjustAuthorisationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdjustAuthorisationRequest` properties.", entry.getKey())); } } @@ -477,7 +483,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `modificationAmount` if (jsonObj.getAsJsonObject("modificationAmount") != null) { @@ -489,11 +495,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -501,7 +507,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -517,11 +523,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/Amount.java b/src/main/java/com/adyen/model/payment/Amount.java index 267971926..caafba34d 100644 --- a/src/main/java/com/adyen/model/payment/Amount.java +++ b/src/main/java/com/adyen/model/payment/Amount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ApplicationInfo.java b/src/main/java/com/adyen/model/payment/ApplicationInfo.java index 561089b24..09f6ac627 100644 --- a/src/main/java/com/adyen/model/payment/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/payment/ApplicationInfo.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -277,6 +279,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ApplicationInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -297,7 +303,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ApplicationInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ApplicationInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ApplicationInfo` properties.", entry.getKey())); } } // validate the optional field `adyenLibrary` diff --git a/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java index 39cd09901..8e94293e9 100644 --- a/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("pspReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AuthenticationResultRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AuthenticationResultRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthenticationResultRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AuthenticationResultRequest` properties.", entry.getKey())); } } @@ -191,11 +197,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java index 71cfafb53..e06e23f71 100644 --- a/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AuthenticationResultResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!AuthenticationResultResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AuthenticationResultResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AuthenticationResultResponse` properties.", entry.getKey())); } } // validate the optional field `threeDS1Result` diff --git a/src/main/java/com/adyen/model/payment/BankAccount.java b/src/main/java/com/adyen/model/payment/BankAccount.java index 372e6bbfc..ddebb10e3 100644 --- a/src/main/java/com/adyen/model/payment/BankAccount.java +++ b/src/main/java/com/adyen/model/payment/BankAccount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -360,6 +362,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -380,44 +386,44 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccount` properties.", entry.getKey())); } } // validate the optional field bankAccountNumber if (jsonObj.get("bankAccountNumber") != null && !jsonObj.get("bankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").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())); + log.log(Level.WARNING, 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 bankLocationId if (jsonObj.get("bankLocationId") != null && !jsonObj.get("bankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/BrowserInfo.java b/src/main/java/com/adyen/model/payment/BrowserInfo.java index 76f5e3670..7d6734272 100644 --- a/src/main/java/com/adyen/model/payment/BrowserInfo.java +++ b/src/main/java/com/adyen/model/payment/BrowserInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -368,6 +370,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("timeZoneOffset"); openapiRequiredFields.add("userAgent"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BrowserInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -388,7 +394,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BrowserInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BrowserInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BrowserInfo` properties.", entry.getKey())); } } @@ -400,15 +406,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field acceptHeader if (jsonObj.get("acceptHeader") != null && !jsonObj.get("acceptHeader").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acceptHeader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptHeader").toString())); + log.log(Level.WARNING, String.format("Expected the field `acceptHeader` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acceptHeader").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())); + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); } // validate the optional field userAgent if (jsonObj.get("userAgent") != null && !jsonObj.get("userAgent").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); + log.log(Level.WARNING, String.format("Expected the field `userAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userAgent").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java index 1db030d8e..ed9aa4e6b 100644 --- a/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -375,6 +377,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CancelOrRefundRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -395,7 +401,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CancelOrRefundRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CancelOrRefundRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CancelOrRefundRequest` properties.", entry.getKey())); } } @@ -407,7 +413,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `mpiData` if (jsonObj.getAsJsonObject("mpiData") != null) { @@ -415,11 +421,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -427,15 +433,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/CancelRequest.java b/src/main/java/com/adyen/model/payment/CancelRequest.java index 2ffa85ca9..66f062f17 100644 --- a/src/main/java/com/adyen/model/payment/CancelRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelRequest.java @@ -48,6 +48,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -414,6 +416,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CancelRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -434,7 +440,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CancelRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CancelRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CancelRequest` properties.", entry.getKey())); } } @@ -446,7 +452,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `mpiData` if (jsonObj.getAsJsonObject("mpiData") != null) { @@ -454,11 +460,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -466,7 +472,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -482,11 +488,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/CaptureRequest.java b/src/main/java/com/adyen/model/payment/CaptureRequest.java index ea0b70179..834860932 100644 --- a/src/main/java/com/adyen/model/payment/CaptureRequest.java +++ b/src/main/java/com/adyen/model/payment/CaptureRequest.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -445,6 +447,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("modificationAmount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CaptureRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -465,7 +471,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CaptureRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CaptureRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CaptureRequest` properties.", entry.getKey())); } } @@ -477,7 +483,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `modificationAmount` if (jsonObj.getAsJsonObject("modificationAmount") != null) { @@ -489,11 +495,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -501,7 +507,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -517,11 +523,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/Card.java b/src/main/java/com/adyen/model/payment/Card.java index 3617fd5d4..08b210f8a 100644 --- a/src/main/java/com/adyen/model/payment/Card.java +++ b/src/main/java/com/adyen/model/payment/Card.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -331,6 +333,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Card.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -351,40 +357,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Card.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Card` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); } // validate the optional field issueNumber if (jsonObj.get("issueNumber") != null && !jsonObj.get("issueNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // validate the optional field startMonth if (jsonObj.get("startMonth") != null && !jsonObj.get("startMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); } // validate the optional field startYear if (jsonObj.get("startYear") != null && !jsonObj.get("startYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/CommonField.java b/src/main/java/com/adyen/model/payment/CommonField.java index 0c806cd5f..b656cc966 100644 --- a/src/main/java/com/adyen/model/payment/CommonField.java +++ b/src/main/java/com/adyen/model/payment/CommonField.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CommonField.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,16 +183,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CommonField.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CommonField` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CommonField` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field version if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + log.log(Level.WARNING, String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java index d25add229..8009b33b7 100644 --- a/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -269,6 +271,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DeviceRenderOptions.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -289,7 +295,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DeviceRenderOptions.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeviceRenderOptions` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DeviceRenderOptions` properties.", entry.getKey())); } } // ensure the field sdkInterface can be parsed to an enum value @@ -301,7 +307,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("sdkUiType") != null && !jsonObj.get("sdkUiType").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkUiType` to be an array in the JSON string but got `%s`", jsonObj.get("sdkUiType").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkUiType` to be an array in the JSON string but got `%s`", jsonObj.get("sdkUiType").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/DonationRequest.java b/src/main/java/com/adyen/model/payment/DonationRequest.java index 7caee1bc6..e692ad39e 100644 --- a/src/main/java/com/adyen/model/payment/DonationRequest.java +++ b/src/main/java/com/adyen/model/payment/DonationRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -278,6 +280,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("modificationAmount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DonationRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -298,7 +304,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DonationRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DonationRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DonationRequest` properties.", entry.getKey())); } } @@ -310,11 +316,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field donationAccount if (jsonObj.get("donationAccount") != null && !jsonObj.get("donationAccount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `donationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationAccount").toString())); + log.log(Level.WARNING, String.format("Expected the field `donationAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("donationAccount").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())); + log.log(Level.WARNING, 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 `modificationAmount` if (jsonObj.getAsJsonObject("modificationAmount") != null) { @@ -322,7 +328,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -330,7 +336,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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/payment/ExternalPlatform.java b/src/main/java/com/adyen/model/payment/ExternalPlatform.java index 2f98c9eaa..491280df5 100644 --- a/src/main/java/com/adyen/model/payment/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/payment/ExternalPlatform.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ExternalPlatform.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ExternalPlatform.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ExternalPlatform` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ExternalPlatform` properties.", entry.getKey())); } } // validate the optional field integrator if (jsonObj.get("integrator") != null && !jsonObj.get("integrator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `integrator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrator").toString())); + log.log(Level.WARNING, String.format("Expected the field `integrator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("integrator").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field version if (jsonObj.get("version") != null && !jsonObj.get("version").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); + log.log(Level.WARNING, String.format("Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ForexQuote.java b/src/main/java/com/adyen/model/payment/ForexQuote.java index f7f2c2cee..532edb3eb 100644 --- a/src/main/java/com/adyen/model/payment/ForexQuote.java +++ b/src/main/java/com/adyen/model/payment/ForexQuote.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -451,6 +453,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("basePoints"); openapiRequiredFields.add("validTill"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ForexQuote.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -471,7 +477,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ForexQuote.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ForexQuote` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ForexQuote` properties.", entry.getKey())); } } @@ -483,11 +489,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field account if (jsonObj.get("account") != null && !jsonObj.get("account").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); + log.log(Level.WARNING, String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); } // 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())); + log.log(Level.WARNING, 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 `baseAmount` if (jsonObj.getAsJsonObject("baseAmount") != null) { @@ -503,7 +509,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `sell` if (jsonObj.getAsJsonObject("sell") != null) { @@ -511,15 +517,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field signature if (jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + log.log(Level.WARNING, String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); } // validate the optional field source if (jsonObj.get("source") != null && !jsonObj.get("source").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").toString())); + log.log(Level.WARNING, String.format("Expected the field `source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("source").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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/FraudCheckResult.java b/src/main/java/com/adyen/model/payment/FraudCheckResult.java index ccef65785..f52568c08 100644 --- a/src/main/java/com/adyen/model/payment/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResult.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -189,6 +191,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("checkId"); openapiRequiredFields.add("name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudCheckResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -209,7 +215,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FraudCheckResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResult` properties.", entry.getKey())); } } @@ -221,7 +227,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java index b590a4fa1..73d669e4f 100644 --- a/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudCheckResultWrapper.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResultWrapper` properties.", entry.getKey())); } } // validate the optional field `FraudCheckResult` diff --git a/src/main/java/com/adyen/model/payment/FraudResult.java b/src/main/java/com/adyen/model/payment/FraudResult.java index 11e69289f..8ff56dd74 100644 --- a/src/main/java/com/adyen/model/payment/FraudResult.java +++ b/src/main/java/com/adyen/model/payment/FraudResult.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -169,6 +171,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("accountScore"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -189,7 +195,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FraudResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudResult` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/payment/FundDestination.java b/src/main/java/com/adyen/model/payment/FundDestination.java index cb7f154be..0f719dc1e 100644 --- a/src/main/java/com/adyen/model/payment/FundDestination.java +++ b/src/main/java/com/adyen/model/payment/FundDestination.java @@ -48,6 +48,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -375,6 +377,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FundDestination.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -395,7 +401,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FundDestination.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FundDestination` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FundDestination` properties.", entry.getKey())); } } // validate the optional field `billingAddress` @@ -408,11 +414,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -420,7 +426,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `subMerchant` if (jsonObj.getAsJsonObject("subMerchant") != null) { @@ -428,7 +434,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/FundSource.java b/src/main/java/com/adyen/model/payment/FundSource.java index e2d5115f4..9077c8ad0 100644 --- a/src/main/java/com/adyen/model/payment/FundSource.java +++ b/src/main/java/com/adyen/model/payment/FundSource.java @@ -47,6 +47,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -287,6 +289,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FundSource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -307,7 +313,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FundSource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FundSource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FundSource` properties.", entry.getKey())); } } // validate the optional field `billingAddress` @@ -320,7 +326,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -328,7 +334,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/Installments.java b/src/main/java/com/adyen/model/payment/Installments.java index 99fd1d1ef..edf9f8802 100644 --- a/src/main/java/com/adyen/model/payment/Installments.java +++ b/src/main/java/com/adyen/model/payment/Installments.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -205,6 +207,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Installments.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -225,7 +231,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Installments.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Installments` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Installments` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/payment/Mandate.java b/src/main/java/com/adyen/model/payment/Mandate.java index 71918180f..e54894db7 100644 --- a/src/main/java/com/adyen/model/payment/Mandate.java +++ b/src/main/java/com/adyen/model/payment/Mandate.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -489,6 +491,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("endsAt"); openapiRequiredFields.add("frequency"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Mandate.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -509,7 +515,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Mandate.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Mandate` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Mandate` properties.", entry.getKey())); } } @@ -521,7 +527,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field amount if (jsonObj.get("amount") != null && !jsonObj.get("amount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount").toString())); + log.log(Level.WARNING, String.format("Expected the field `amount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amount").toString())); } // ensure the field amountRule can be parsed to an enum value if (jsonObj.get("amountRule") != null) { @@ -539,11 +545,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingDay if (jsonObj.get("billingDay") != null && !jsonObj.get("billingDay").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingDay").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingDay` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingDay").toString())); } // validate the optional field endsAt if (jsonObj.get("endsAt") != null && !jsonObj.get("endsAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `endsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endsAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `endsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("endsAt").toString())); } // ensure the field frequency can be parsed to an enum value if (jsonObj.get("frequency") != null) { @@ -554,11 +560,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field remarks if (jsonObj.get("remarks") != null && !jsonObj.get("remarks").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); + log.log(Level.WARNING, String.format("Expected the field `remarks` to be a primitive type in the JSON string but got `%s`", jsonObj.get("remarks").toString())); } // validate the optional field startsAt if (jsonObj.get("startsAt") != null && !jsonObj.get("startsAt").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startsAt").toString())); + log.log(Level.WARNING, String.format("Expected the field `startsAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startsAt").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/MerchantDevice.java b/src/main/java/com/adyen/model/payment/MerchantDevice.java index 324099a75..679aaa5c7 100644 --- a/src/main/java/com/adyen/model/payment/MerchantDevice.java +++ b/src/main/java/com/adyen/model/payment/MerchantDevice.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantDevice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantDevice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantDevice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantDevice` properties.", entry.getKey())); } } // validate the optional field os if (jsonObj.get("os") != null && !jsonObj.get("os").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); + log.log(Level.WARNING, String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); } // validate the optional field osVersion if (jsonObj.get("osVersion") != null && !jsonObj.get("osVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").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())); + log.log(Level.WARNING, 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/payment/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java index b79e3f436..90fe40bd6 100644 --- a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -620,6 +622,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantRiskIndicator.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -640,7 +646,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantRiskIndicator.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantRiskIndicator` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantRiskIndicator` properties.", entry.getKey())); } } // ensure the field deliveryAddressIndicator can be parsed to an enum value @@ -652,11 +658,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deliveryEmail if (jsonObj.get("deliveryEmail") != null && !jsonObj.get("deliveryEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmail").toString())); } // validate the optional field deliveryEmailAddress if (jsonObj.get("deliveryEmailAddress") != null && !jsonObj.get("deliveryEmailAddress").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deliveryEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmailAddress").toString())); + log.log(Level.WARNING, String.format("Expected the field `deliveryEmailAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deliveryEmailAddress").toString())); } // ensure the field deliveryTimeframe can be parsed to an enum value if (jsonObj.get("deliveryTimeframe") != null) { @@ -671,19 +677,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field giftCardCurr if (jsonObj.get("giftCardCurr") != null && !jsonObj.get("giftCardCurr").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `giftCardCurr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("giftCardCurr").toString())); + log.log(Level.WARNING, String.format("Expected the field `giftCardCurr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("giftCardCurr").toString())); } // validate the optional field preOrderPurchaseInd if (jsonObj.get("preOrderPurchaseInd") != null && !jsonObj.get("preOrderPurchaseInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `preOrderPurchaseInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("preOrderPurchaseInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `preOrderPurchaseInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("preOrderPurchaseInd").toString())); } // validate the optional field reorderItemsInd if (jsonObj.get("reorderItemsInd") != null && !jsonObj.get("reorderItemsInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `reorderItemsInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reorderItemsInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `reorderItemsInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reorderItemsInd").toString())); } // validate the optional field shipIndicator if (jsonObj.get("shipIndicator") != null && !jsonObj.get("shipIndicator").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shipIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipIndicator").toString())); + log.log(Level.WARNING, String.format("Expected the field `shipIndicator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipIndicator").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ModificationResult.java b/src/main/java/com/adyen/model/payment/ModificationResult.java index 6268bc262..a0c5ab32c 100644 --- a/src/main/java/com/adyen/model/payment/ModificationResult.java +++ b/src/main/java/com/adyen/model/payment/ModificationResult.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -258,6 +260,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("response"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ModificationResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -278,7 +284,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ModificationResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModificationResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ModificationResult` properties.", entry.getKey())); } } @@ -290,7 +296,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } // ensure the field response can be parsed to an enum value if (jsonObj.get("response") != null) { diff --git a/src/main/java/com/adyen/model/payment/Name.java b/src/main/java/com/adyen/model/payment/Name.java index 2e6f05f85..fa541c2b5 100644 --- a/src/main/java/com/adyen/model/payment/Name.java +++ b/src/main/java/com/adyen/model/payment/Name.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -191,11 +197,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest.java b/src/main/java/com/adyen/model/payment/PaymentRequest.java index 34141b0b4..3fb17f033 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest.java @@ -66,6 +66,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -1888,6 +1890,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1908,7 +1914,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest` properties.", entry.getKey())); } } @@ -1960,7 +1966,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceFingerprint if (jsonObj.get("deviceFingerprint") != null && !jsonObj.get("deviceFingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); } // ensure the field entityType can be parsed to an enum value if (jsonObj.get("entityType") != null) { @@ -1994,15 +2000,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `merchantRiskIndicator` if (jsonObj.getAsJsonObject("merchantRiskIndicator") != null) { @@ -2014,11 +2020,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field nationality if (jsonObj.get("nationality") != null && !jsonObj.get("nationality").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); + log.log(Level.WARNING, String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -2037,27 +2043,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedBrand if (jsonObj.get("selectedBrand") != null && !jsonObj.get("selectedBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); } // validate the optional field selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field sessionId if (jsonObj.get("sessionId") != null && !jsonObj.get("sessionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -2068,7 +2074,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -2076,15 +2082,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -2100,11 +2106,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field `threeDS2RequestData` if (jsonObj.getAsJsonObject("threeDS2RequestData") != null) { @@ -2112,7 +2118,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field totalsGroup if (jsonObj.get("totalsGroup") != null && !jsonObj.get("totalsGroup").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); + log.log(Level.WARNING, String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest3d.java b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java index eb661e758..6f1646d69 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest3d.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java @@ -59,6 +59,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -1557,6 +1559,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("paResponse"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentRequest3d.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1577,7 +1583,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentRequest3d.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest3d` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest3d` properties.", entry.getKey())); } } @@ -1621,7 +1627,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceFingerprint if (jsonObj.get("deviceFingerprint") != null && !jsonObj.get("deviceFingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); } // validate the optional field `installments` if (jsonObj.getAsJsonObject("installments") != null) { @@ -1629,19 +1635,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); } // validate the optional field md if (jsonObj.get("md") != null && !jsonObj.get("md").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `md` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md").toString())); + log.log(Level.WARNING, String.format("Expected the field `md` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `merchantRiskIndicator` if (jsonObj.getAsJsonObject("merchantRiskIndicator") != null) { @@ -1649,11 +1655,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field paResponse if (jsonObj.get("paResponse") != null && !jsonObj.get("paResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `paResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paResponse").toString())); } // validate the optional field `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -1668,27 +1674,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedBrand if (jsonObj.get("selectedBrand") != null && !jsonObj.get("selectedBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); } // validate the optional field selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field sessionId if (jsonObj.get("sessionId") != null && !jsonObj.get("sessionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -1699,7 +1705,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -1707,15 +1713,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -1731,11 +1737,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field `threeDS2RequestData` if (jsonObj.getAsJsonObject("threeDS2RequestData") != null) { @@ -1743,7 +1749,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field totalsGroup if (jsonObj.get("totalsGroup") != null && !jsonObj.get("totalsGroup").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); + log.log(Level.WARNING, String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java index 869f3a66f..37a6c921c 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java @@ -60,6 +60,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -1558,6 +1560,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentRequest3ds2.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1578,7 +1584,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentRequest3ds2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest3ds2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentRequest3ds2` properties.", entry.getKey())); } } @@ -1622,7 +1628,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceFingerprint if (jsonObj.get("deviceFingerprint") != null && !jsonObj.get("deviceFingerprint").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceFingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceFingerprint").toString())); } // validate the optional field `installments` if (jsonObj.getAsJsonObject("installments") != null) { @@ -1630,15 +1636,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, 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 merchantOrderReference if (jsonObj.get("merchantOrderReference") != null && !jsonObj.get("merchantOrderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantOrderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantOrderReference").toString())); } // validate the optional field `merchantRiskIndicator` if (jsonObj.getAsJsonObject("merchantRiskIndicator") != null) { @@ -1646,7 +1652,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field orderReference if (jsonObj.get("orderReference") != null && !jsonObj.get("orderReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `orderReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orderReference").toString())); } // validate the optional field `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -1661,27 +1667,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedBrand if (jsonObj.get("selectedBrand") != null && !jsonObj.get("selectedBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); } // validate the optional field selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field sessionId if (jsonObj.get("sessionId") != null && !jsonObj.get("sessionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sessionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sessionId").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field shopperIP if (jsonObj.get("shopperIP") != null && !jsonObj.get("shopperIP").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperIP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperIP").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -1692,7 +1698,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperLocale if (jsonObj.get("shopperLocale") != null && !jsonObj.get("shopperLocale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperLocale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperLocale").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -1700,15 +1706,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -1724,11 +1730,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } // validate the optional field `threeDS2RequestData` if (jsonObj.getAsJsonObject("threeDS2RequestData") != null) { @@ -1740,11 +1746,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDS2Token if (jsonObj.get("threeDS2Token") != null && !jsonObj.get("threeDS2Token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDS2Token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDS2Token").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDS2Token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDS2Token").toString())); } // validate the optional field totalsGroup if (jsonObj.get("totalsGroup") != null && !jsonObj.get("totalsGroup").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); + log.log(Level.WARNING, String.format("Expected the field `totalsGroup` to be a primitive type in the JSON string but got `%s`", jsonObj.get("totalsGroup").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/PaymentResult.java b/src/main/java/com/adyen/model/payment/PaymentResult.java index f9858d872..df11c0616 100644 --- a/src/main/java/com/adyen/model/payment/PaymentResult.java +++ b/src/main/java/com/adyen/model/payment/PaymentResult.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -500,6 +502,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -520,12 +526,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PaymentResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PaymentResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentResult` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 `dccAmount` if (jsonObj.getAsJsonObject("dccAmount") != null) { @@ -533,7 +539,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dccSignature if (jsonObj.get("dccSignature") != null && !jsonObj.get("dccSignature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dccSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dccSignature").toString())); + log.log(Level.WARNING, String.format("Expected the field `dccSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dccSignature").toString())); } // validate the optional field `fraudResult` if (jsonObj.getAsJsonObject("fraudResult") != null) { @@ -541,23 +547,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field issuerUrl if (jsonObj.get("issuerUrl") != null && !jsonObj.get("issuerUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerUrl").toString())); } // validate the optional field md if (jsonObj.get("md") != null && !jsonObj.get("md").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `md` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md").toString())); + log.log(Level.WARNING, String.format("Expected the field `md` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md").toString())); } // validate the optional field paRequest if (jsonObj.get("paRequest") != null && !jsonObj.get("paRequest").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paRequest").toString())); + log.log(Level.WARNING, String.format("Expected the field `paRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paRequest").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/payment/Phone.java b/src/main/java/com/adyen/model/payment/Phone.java index 1a5c2702d..f5a4acf01 100644 --- a/src/main/java/com/adyen/model/payment/Phone.java +++ b/src/main/java/com/adyen/model/payment/Phone.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Phone.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,16 +183,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Phone.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Phone` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Phone` properties.", entry.getKey())); } } // validate the optional field cc if (jsonObj.get("cc") != null && !jsonObj.get("cc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cc").toString())); + log.log(Level.WARNING, String.format("Expected the field `cc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cc").toString())); } // validate the optional field subscriber if (jsonObj.get("subscriber") != null && !jsonObj.get("subscriber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `subscriber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriber").toString())); + log.log(Level.WARNING, String.format("Expected the field `subscriber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("subscriber").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java index 2034ea8b0..79ac59c0e 100644 --- a/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -235,6 +237,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PlatformChargebackLogic.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -255,7 +261,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PlatformChargebackLogic.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PlatformChargebackLogic` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PlatformChargebackLogic` properties.", entry.getKey())); } } // ensure the field behavior can be parsed to an enum value @@ -267,11 +273,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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/payment/Recurring.java b/src/main/java/com/adyen/model/payment/Recurring.java index 09d310b41..8a8ce6540 100644 --- a/src/main/java/com/adyen/model/payment/Recurring.java +++ b/src/main/java/com/adyen/model/payment/Recurring.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -341,6 +343,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Recurring.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -361,7 +367,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Recurring.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties.", entry.getKey())); } } // ensure the field contract can be parsed to an enum value @@ -373,11 +379,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringDetailName if (jsonObj.get("recurringDetailName") != null && !jsonObj.get("recurringDetailName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field tokenService can be parsed to an enum value if (jsonObj.get("tokenService") != null) { diff --git a/src/main/java/com/adyen/model/payment/RefundRequest.java b/src/main/java/com/adyen/model/payment/RefundRequest.java index e1abd35ec..4f4906805 100644 --- a/src/main/java/com/adyen/model/payment/RefundRequest.java +++ b/src/main/java/com/adyen/model/payment/RefundRequest.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -445,6 +447,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("modificationAmount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RefundRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -465,7 +471,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RefundRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RefundRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RefundRequest` properties.", entry.getKey())); } } @@ -477,7 +483,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `modificationAmount` if (jsonObj.getAsJsonObject("modificationAmount") != null) { @@ -489,11 +495,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -501,7 +507,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -517,11 +523,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java index dab3f96f8..8acb6c6fb 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalData3DSecure.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,24 +270,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalData3DSecure.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalData3DSecure` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalData3DSecure` properties.", entry.getKey())); } } // validate the optional field cardHolderInfo if (jsonObj.get("cardHolderInfo") != null && !jsonObj.get("cardHolderInfo").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); } // validate the optional field cavv if (jsonObj.get("cavv") != null && !jsonObj.get("cavv").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // validate the optional field scaExemptionRequested if (jsonObj.get("scaExemptionRequested") != null && !jsonObj.get("scaExemptionRequested").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scaExemptionRequested` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemptionRequested").toString())); + log.log(Level.WARNING, String.format("Expected the field `scaExemptionRequested` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemptionRequested").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java index aedd18ccd..247d06a26 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataBillingAddress.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,32 +299,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataBillingAddress.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataBillingAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataBillingAddress` properties.", entry.getKey())); } } // validate the optional field billingAddress.city if (jsonObj.get("billingAddress.city") != null && !jsonObj.get("billingAddress.city").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.city").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.city").toString())); } // validate the optional field billingAddress.country if (jsonObj.get("billingAddress.country") != null && !jsonObj.get("billingAddress.country").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.country").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.country").toString())); } // validate the optional field billingAddress.houseNumberOrName if (jsonObj.get("billingAddress.houseNumberOrName") != null && !jsonObj.get("billingAddress.houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.houseNumberOrName").toString())); } // validate the optional field billingAddress.postalCode if (jsonObj.get("billingAddress.postalCode") != null && !jsonObj.get("billingAddress.postalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.postalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.postalCode").toString())); } // validate the optional field billingAddress.stateOrProvince if (jsonObj.get("billingAddress.stateOrProvince") != null && !jsonObj.get("billingAddress.stateOrProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.stateOrProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.stateOrProvince").toString())); } // validate the optional field billingAddress.street if (jsonObj.get("billingAddress.street") != null && !jsonObj.get("billingAddress.street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.street").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.street").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java index 89f08ff85..6879b697c 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -331,6 +333,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataCard.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -351,40 +357,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataCard.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCard` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCard` properties.", entry.getKey())); } } // validate the optional field cardBin if (jsonObj.get("cardBin") != null && !jsonObj.get("cardBin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardBin").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardBin").toString())); } // validate the optional field cardHolderName if (jsonObj.get("cardHolderName") != null && !jsonObj.get("cardHolderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderName").toString())); } // validate the optional field cardIssuingBank if (jsonObj.get("cardIssuingBank") != null && !jsonObj.get("cardIssuingBank").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingBank").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingBank").toString())); } // validate the optional field cardIssuingCountry if (jsonObj.get("cardIssuingCountry") != null && !jsonObj.get("cardIssuingCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCountry").toString())); } // validate the optional field cardIssuingCurrency if (jsonObj.get("cardIssuingCurrency") != null && !jsonObj.get("cardIssuingCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCurrency").toString())); } // validate the optional field cardPaymentMethod if (jsonObj.get("cardPaymentMethod") != null && !jsonObj.get("cardPaymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardPaymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardPaymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardPaymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardPaymentMethod").toString())); } // validate the optional field cardSummary if (jsonObj.get("cardSummary") != null && !jsonObj.get("cardSummary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardSummary").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardSummary").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())); + log.log(Level.WARNING, String.format("Expected the field `issuerBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerBin").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java index 86afdb5a4..155e5f3f5 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -1906,6 +1908,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataCommon.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1926,96 +1932,96 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataCommon.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCommon` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCommon` properties.", entry.getKey())); } } // validate the optional field acquirerAccountCode if (jsonObj.get("acquirerAccountCode") != null && !jsonObj.get("acquirerAccountCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerAccountCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerAccountCode").toString())); } // validate the optional field acquirerCode if (jsonObj.get("acquirerCode") != null && !jsonObj.get("acquirerCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerCode").toString())); } // validate the optional field acquirerReference if (jsonObj.get("acquirerReference") != null && !jsonObj.get("acquirerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerReference").toString())); } // validate the optional field alias if (jsonObj.get("alias") != null && !jsonObj.get("alias").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); + log.log(Level.WARNING, String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); } // validate the optional field aliasType if (jsonObj.get("aliasType") != null && !jsonObj.get("aliasType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").toString())); + log.log(Level.WARNING, String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").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())); + log.log(Level.WARNING, 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 authorisationMid if (jsonObj.get("authorisationMid") != null && !jsonObj.get("authorisationMid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisationMid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationMid").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisationMid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationMid").toString())); } // validate the optional field authorisedAmountCurrency if (jsonObj.get("authorisedAmountCurrency") != null && !jsonObj.get("authorisedAmountCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisedAmountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisedAmountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountCurrency").toString())); } // validate the optional field authorisedAmountValue if (jsonObj.get("authorisedAmountValue") != null && !jsonObj.get("authorisedAmountValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisedAmountValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisedAmountValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountValue").toString())); } // validate the optional field avsResult if (jsonObj.get("avsResult") != null && !jsonObj.get("avsResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResult").toString())); } // validate the optional field avsResultRaw if (jsonObj.get("avsResultRaw") != null && !jsonObj.get("avsResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").toString())); } // validate the optional field coBrandedWith if (jsonObj.get("coBrandedWith") != null && !jsonObj.get("coBrandedWith").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `coBrandedWith` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coBrandedWith").toString())); + log.log(Level.WARNING, String.format("Expected the field `coBrandedWith` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coBrandedWith").toString())); } // validate the optional field cvcResult if (jsonObj.get("cvcResult") != null && !jsonObj.get("cvcResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResult").toString())); } // validate the optional field cvcResultRaw if (jsonObj.get("cvcResultRaw") != null && !jsonObj.get("cvcResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // validate the optional field expiryDate if (jsonObj.get("expiryDate") != null && !jsonObj.get("expiryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); } // validate the optional field extraCostsCurrency if (jsonObj.get("extraCostsCurrency") != null && !jsonObj.get("extraCostsCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extraCostsCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `extraCostsCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsCurrency").toString())); } // validate the optional field extraCostsValue if (jsonObj.get("extraCostsValue") != null && !jsonObj.get("extraCostsValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extraCostsValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `extraCostsValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsValue").toString())); } // validate the optional field fraudCheck-[itemNr]-[FraudCheckname] if (jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]") != null && !jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fraudCheck-[itemNr]-[FraudCheckname]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").toString())); + log.log(Level.WARNING, String.format("Expected the field `fraudCheck-[itemNr]-[FraudCheckname]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").toString())); } // validate the optional field fraudManualReview if (jsonObj.get("fraudManualReview") != null && !jsonObj.get("fraudManualReview").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fraudManualReview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudManualReview").toString())); + log.log(Level.WARNING, String.format("Expected the field `fraudManualReview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudManualReview").toString())); } // ensure the field fraudResultType can be parsed to an enum value if (jsonObj.get("fraudResultType") != null) { @@ -2026,87 +2032,87 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field fundingSource if (jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); + log.log(Level.WARNING, String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); } // validate the optional field fundsAvailability 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())); + log.log(Level.WARNING, 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 inferredRefusalReason if (jsonObj.get("inferredRefusalReason") != null && !jsonObj.get("inferredRefusalReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `inferredRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inferredRefusalReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `inferredRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inferredRefusalReason").toString())); } // validate the optional field isCardCommercial if (jsonObj.get("isCardCommercial") != null && !jsonObj.get("isCardCommercial").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `isCardCommercial` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isCardCommercial").toString())); + log.log(Level.WARNING, String.format("Expected the field `isCardCommercial` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isCardCommercial").toString())); } // validate the optional field issuerCountry if (jsonObj.get("issuerCountry") != null && !jsonObj.get("issuerCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); } // validate the optional field liabilityShift if (jsonObj.get("liabilityShift") != null && !jsonObj.get("liabilityShift").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `liabilityShift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("liabilityShift").toString())); + log.log(Level.WARNING, String.format("Expected the field `liabilityShift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("liabilityShift").toString())); } // validate the optional field mcBankNetReferenceNumber if (jsonObj.get("mcBankNetReferenceNumber") != null && !jsonObj.get("mcBankNetReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcBankNetReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcBankNetReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcBankNetReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcBankNetReferenceNumber").toString())); } // validate the optional field merchantAdviceCode if (jsonObj.get("merchantAdviceCode") != null && !jsonObj.get("merchantAdviceCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantAdviceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAdviceCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantAdviceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAdviceCode").toString())); } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field paymentAccountReference if (jsonObj.get("paymentAccountReference") != null && !jsonObj.get("paymentAccountReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAccountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccountReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAccountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccountReference").toString())); } // validate the optional field paymentMethod if (jsonObj.get("paymentMethod") != null && !jsonObj.get("paymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); } // validate the optional field paymentMethodVariant if (jsonObj.get("paymentMethodVariant") != null && !jsonObj.get("paymentMethodVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); } // validate the optional field payoutEligible if (jsonObj.get("payoutEligible") != null && !jsonObj.get("payoutEligible").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); + log.log(Level.WARNING, String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); } // validate the optional field realtimeAccountUpdaterStatus if (jsonObj.get("realtimeAccountUpdaterStatus") != null && !jsonObj.get("realtimeAccountUpdaterStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `realtimeAccountUpdaterStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realtimeAccountUpdaterStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `realtimeAccountUpdaterStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realtimeAccountUpdaterStatus").toString())); } // validate the optional field receiptFreeText if (jsonObj.get("receiptFreeText") != null && !jsonObj.get("receiptFreeText").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `receiptFreeText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptFreeText").toString())); + log.log(Level.WARNING, String.format("Expected the field `receiptFreeText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptFreeText").toString())); } // validate the optional field recurring.contractTypes if (jsonObj.get("recurring.contractTypes") != null && !jsonObj.get("recurring.contractTypes").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.contractTypes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.contractTypes").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.contractTypes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.contractTypes").toString())); } // validate the optional field recurring.firstPspReference if (jsonObj.get("recurring.firstPspReference") != null && !jsonObj.get("recurring.firstPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.firstPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.firstPspReference").toString())); } // validate the optional field recurring.recurringDetailReference if (jsonObj.get("recurring.recurringDetailReference") != null && !jsonObj.get("recurring.recurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.recurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.recurringDetailReference").toString())); } // validate the optional field recurring.shopperReference if (jsonObj.get("recurring.shopperReference") != null && !jsonObj.get("recurring.shopperReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.shopperReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.shopperReference").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2117,59 +2123,59 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field referred if (jsonObj.get("referred") != null && !jsonObj.get("referred").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `referred` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referred").toString())); + log.log(Level.WARNING, String.format("Expected the field `referred` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referred").toString())); } // validate the optional field refusalReasonRaw if (jsonObj.get("refusalReasonRaw") != null && !jsonObj.get("refusalReasonRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refusalReasonRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `refusalReasonRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonRaw").toString())); } // validate the optional field requestAmount if (jsonObj.get("requestAmount") != null && !jsonObj.get("requestAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAmount").toString())); } // validate the optional field requestCurrencyCode if (jsonObj.get("requestCurrencyCode") != null && !jsonObj.get("requestCurrencyCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestCurrencyCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestCurrencyCode").toString())); } // validate the optional field shopperInteraction if (jsonObj.get("shopperInteraction") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); } // 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())); + log.log(Level.WARNING, 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 terminalId if (jsonObj.get("terminalId") != null && !jsonObj.get("terminalId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); } // validate the optional field threeDAuthenticated if (jsonObj.get("threeDAuthenticated") != null && !jsonObj.get("threeDAuthenticated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); } // validate the optional field threeDAuthenticatedResponse if (jsonObj.get("threeDAuthenticatedResponse") != null && !jsonObj.get("threeDAuthenticatedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); } // validate the optional field threeDOffered if (jsonObj.get("threeDOffered") != null && !jsonObj.get("threeDOffered").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); } // validate the optional field threeDOfferedResponse if (jsonObj.get("threeDOfferedResponse") != null && !jsonObj.get("threeDOfferedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } // validate the optional field visaTransactionId if (jsonObj.get("visaTransactionId") != null && !jsonObj.get("visaTransactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `visaTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaTransactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `visaTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaTransactionId").toString())); } // validate the optional field xid if (jsonObj.get("xid") != null && !jsonObj.get("xid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); + log.log(Level.WARNING, String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java index cf64b2aa3..374ae67f5 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -447,6 +449,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataInstallments.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -467,56 +473,56 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataInstallments.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataInstallments` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataInstallments` properties.", entry.getKey())); } } // validate the optional field installmentPaymentData.installmentType if (jsonObj.get("installmentPaymentData.installmentType") != null && !jsonObj.get("installmentPaymentData.installmentType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.installmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.installmentType").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.installmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.installmentType").toString())); } // validate the optional field installmentPaymentData.option[itemNr].annualPercentageRate if (jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate") != null && !jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].annualPercentageRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].annualPercentageRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").toString())); } // validate the optional field installmentPaymentData.option[itemNr].firstInstallmentAmount if (jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount") != null && !jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].firstInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].firstInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").toString())); } // validate the optional field installmentPaymentData.option[itemNr].installmentFee if (jsonObj.get("installmentPaymentData.option[itemNr].installmentFee") != null && !jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].installmentFee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].installmentFee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").toString())); } // validate the optional field installmentPaymentData.option[itemNr].interestRate if (jsonObj.get("installmentPaymentData.option[itemNr].interestRate") != null && !jsonObj.get("installmentPaymentData.option[itemNr].interestRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].interestRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].interestRate").toString())); } // validate the optional field installmentPaymentData.option[itemNr].maximumNumberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].maximumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].maximumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].minimumNumberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].minimumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].minimumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].numberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].numberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].numberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].subsequentInstallmentAmount if (jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount") != null && !jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].subsequentInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].subsequentInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").toString())); } // validate the optional field installmentPaymentData.option[itemNr].totalAmountDue if (jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue") != null && !jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].totalAmountDue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].totalAmountDue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").toString())); } // validate the optional field installmentPaymentData.paymentOptions if (jsonObj.get("installmentPaymentData.paymentOptions") != null && !jsonObj.get("installmentPaymentData.paymentOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.paymentOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.paymentOptions").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.paymentOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.paymentOptions").toString())); } // validate the optional field installments.value if (jsonObj.get("installments.value") != null && !jsonObj.get("installments.value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installments.value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installments.value").toString())); + log.log(Level.WARNING, String.format("Expected the field `installments.value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installments.value").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java index 7c3517c21..99c0152b9 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataNetworkTokens.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataNetworkTokens.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataNetworkTokens` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataNetworkTokens` properties.", entry.getKey())); } } // validate the optional field networkToken.available if (jsonObj.get("networkToken.available") != null && !jsonObj.get("networkToken.available").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.available").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.available").toString())); } // validate the optional field networkToken.bin if (jsonObj.get("networkToken.bin") != null && !jsonObj.get("networkToken.bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.bin").toString())); } // validate the optional field networkToken.tokenSummary if (jsonObj.get("networkToken.tokenSummary") != null && !jsonObj.get("networkToken.tokenSummary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.tokenSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.tokenSummary").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.tokenSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.tokenSummary").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java index c141d66d9..efa8341d8 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataOpi.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,12 +154,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataOpi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataOpi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataOpi` properties.", entry.getKey())); } } // validate the optional field opi.transToken if (jsonObj.get("opi.transToken") != null && !jsonObj.get("opi.transToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `opi.transToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.transToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `opi.transToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.transToken").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java index 8f3fc1278..1739bf2a6 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataSepa.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataSepa.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataSepa` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataSepa` properties.", entry.getKey())); } } // validate the optional field sepadirectdebit.dateOfSignature if (jsonObj.get("sepadirectdebit.dateOfSignature") != null && !jsonObj.get("sepadirectdebit.dateOfSignature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.dateOfSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.dateOfSignature").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.dateOfSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.dateOfSignature").toString())); } // validate the optional field sepadirectdebit.mandateId if (jsonObj.get("sepadirectdebit.mandateId") != null && !jsonObj.get("sepadirectdebit.mandateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.mandateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.mandateId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.mandateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.mandateId").toString())); } // validate the optional field sepadirectdebit.sequenceType if (jsonObj.get("sepadirectdebit.sequenceType") != null && !jsonObj.get("sepadirectdebit.sequenceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.sequenceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.sequenceType").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.sequenceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.sequenceType").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java index a68d9a8c5..8b6e05ba0 100644 --- a/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -215,6 +217,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SDKEphemPubKey.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -235,24 +241,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SDKEphemPubKey.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SDKEphemPubKey` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SDKEphemPubKey` properties.", entry.getKey())); } } // validate the optional field crv if (jsonObj.get("crv") != null && !jsonObj.get("crv").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `crv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("crv").toString())); + log.log(Level.WARNING, String.format("Expected the field `crv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("crv").toString())); } // validate the optional field kty if (jsonObj.get("kty") != null && !jsonObj.get("kty").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `kty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kty").toString())); + log.log(Level.WARNING, String.format("Expected the field `kty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kty").toString())); } // validate the optional field x if (jsonObj.get("x") != null && !jsonObj.get("x").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `x` to be a primitive type in the JSON string but got `%s`", jsonObj.get("x").toString())); + log.log(Level.WARNING, String.format("Expected the field `x` to be a primitive type in the JSON string but got `%s`", jsonObj.get("x").toString())); } // validate the optional field y if (jsonObj.get("y") != null && !jsonObj.get("y").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `y` to be a primitive type in the JSON string but got `%s`", jsonObj.get("y").toString())); + log.log(Level.WARNING, String.format("Expected the field `y` to be a primitive type in the JSON string but got `%s`", jsonObj.get("y").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ServiceError.java b/src/main/java/com/adyen/model/payment/ServiceError.java index 4425f792e..7ad243dd3 100644 --- a/src/main/java/com/adyen/model/payment/ServiceError.java +++ b/src/main/java/com/adyen/model/payment/ServiceError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -284,6 +286,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -304,24 +310,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java index 632da3281..baa419a8f 100644 --- a/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ShopperInteractionDevice.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,20 +212,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ShopperInteractionDevice.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShopperInteractionDevice` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ShopperInteractionDevice` properties.", entry.getKey())); } } // validate the optional field locale if (jsonObj.get("locale") != null && !jsonObj.get("locale").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `locale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locale").toString())); + log.log(Level.WARNING, String.format("Expected the field `locale` to be a primitive type in the JSON string but got `%s`", jsonObj.get("locale").toString())); } // validate the optional field os if (jsonObj.get("os") != null && !jsonObj.get("os").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); + log.log(Level.WARNING, String.format("Expected the field `os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("os").toString())); } // validate the optional field osVersion if (jsonObj.get("osVersion") != null && !jsonObj.get("osVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `osVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("osVersion").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/Split.java b/src/main/java/com/adyen/model/payment/Split.java index 3be520802..2fab87f09 100644 --- a/src/main/java/com/adyen/model/payment/Split.java +++ b/src/main/java/com/adyen/model/payment/Split.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -81,6 +83,18 @@ public enum TypeEnum { PAYMENTFEE("PaymentFee"), + PAYMENTFEEACQUIRING("PaymentFeeAcquiring"), + + PAYMENTFEEADYEN("PaymentFeeAdyen"), + + PAYMENTFEEADYENCOMMISSION("PaymentFeeAdyenCommission"), + + PAYMENTFEEADYENMARKUP("PaymentFeeAdyenMarkup"), + + PAYMENTFEEINTERCHANGE("PaymentFeeInterchange"), + + PAYMENTFEESCHEMEFEE("PaymentFeeSchemeFee"), + REMAINDER("Remainder"), SURCHARGE("Surcharge"), @@ -310,6 +324,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("amount"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Split.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -330,7 +348,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Split.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Split` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Split` properties.", entry.getKey())); } } @@ -342,7 +360,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field account if (jsonObj.get("account") != null && !jsonObj.get("account").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); + log.log(Level.WARNING, String.format("Expected the field `account` to be a primitive type in the JSON string but got `%s`", jsonObj.get("account").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -350,11 +368,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/payment/SplitAmount.java b/src/main/java/com/adyen/model/payment/SplitAmount.java index cd5622b80..315cd1e5c 100644 --- a/src/main/java/com/adyen/model/payment/SplitAmount.java +++ b/src/main/java/com/adyen/model/payment/SplitAmount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SplitAmount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SplitAmount.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SplitAmount` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SplitAmount` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/SubMerchant.java b/src/main/java/com/adyen/model/payment/SubMerchant.java index 06cca6450..08a46e3af 100644 --- a/src/main/java/com/adyen/model/payment/SubMerchant.java +++ b/src/main/java/com/adyen/model/payment/SubMerchant.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubMerchant.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,28 +270,28 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SubMerchant.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubMerchant` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubMerchant` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java index 96a347b98..5ec82da11 100644 --- a/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java +++ b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -415,6 +417,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("originalMerchantReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TechnicalCancelRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -435,7 +441,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TechnicalCancelRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TechnicalCancelRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TechnicalCancelRequest` properties.", entry.getKey())); } } @@ -447,7 +453,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `modificationAmount` if (jsonObj.getAsJsonObject("modificationAmount") != null) { @@ -459,7 +465,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); } // validate the optional field `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -467,7 +473,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -483,11 +489,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ThreeDS1Result.java b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java index ef6b552ae..7c426f2b7 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS1Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS1Result.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,32 +299,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS1Result.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS1Result` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS1Result` properties.", entry.getKey())); } } // validate the optional field cavv if (jsonObj.get("cavv") != null && !jsonObj.get("cavv").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // validate the optional field threeDAuthenticatedResponse if (jsonObj.get("threeDAuthenticatedResponse") != null && !jsonObj.get("threeDAuthenticatedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); } // validate the optional field threeDOfferedResponse if (jsonObj.get("threeDOfferedResponse") != null && !jsonObj.get("threeDOfferedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); } // validate the optional field xid if (jsonObj.get("xid") != null && !jsonObj.get("xid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); + log.log(Level.WARNING, String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java index e9867963e..3a3adfa98 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java @@ -47,6 +47,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -1555,6 +1557,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("deviceChannel"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2RequestData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1575,7 +1581,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2RequestData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2RequestData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2RequestData` properties.", entry.getKey())); } } @@ -1598,11 +1604,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field acquirerBIN if (jsonObj.get("acquirerBIN") != null && !jsonObj.get("acquirerBIN").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerBIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerBIN").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerBIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerBIN").toString())); } // validate the optional field acquirerMerchantID if (jsonObj.get("acquirerMerchantID") != null && !jsonObj.get("acquirerMerchantID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerMerchantID").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerMerchantID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerMerchantID").toString())); } // ensure the field addrMatch can be parsed to an enum value if (jsonObj.get("addrMatch") != null) { @@ -1620,7 +1626,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field deviceChannel if (jsonObj.get("deviceChannel") != null && !jsonObj.get("deviceChannel").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `deviceChannel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceChannel").toString())); + log.log(Level.WARNING, String.format("Expected the field `deviceChannel` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceChannel").toString())); } // validate the optional field `deviceRenderOptions` if (jsonObj.getAsJsonObject("deviceRenderOptions") != null) { @@ -1632,15 +1638,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); } // validate the optional field merchantName if (jsonObj.get("merchantName") != null && !jsonObj.get("merchantName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantName").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantName").toString())); } // validate the optional field messageVersion if (jsonObj.get("messageVersion") != null && !jsonObj.get("messageVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); } // validate the optional field `mobilePhone` if (jsonObj.getAsJsonObject("mobilePhone") != null) { @@ -1648,31 +1654,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field notificationURL if (jsonObj.get("notificationURL") != null && !jsonObj.get("notificationURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `notificationURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `notificationURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationURL").toString())); } // validate the optional field paymentAuthenticationUseCase if (jsonObj.get("paymentAuthenticationUseCase") != null && !jsonObj.get("paymentAuthenticationUseCase").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAuthenticationUseCase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAuthenticationUseCase").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAuthenticationUseCase` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAuthenticationUseCase").toString())); } // validate the optional field purchaseInstalData if (jsonObj.get("purchaseInstalData") != null && !jsonObj.get("purchaseInstalData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `purchaseInstalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purchaseInstalData").toString())); + log.log(Level.WARNING, String.format("Expected the field `purchaseInstalData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("purchaseInstalData").toString())); } // validate the optional field recurringExpiry if (jsonObj.get("recurringExpiry") != null && !jsonObj.get("recurringExpiry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringExpiry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringExpiry").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // validate the optional field sdkAppID if (jsonObj.get("sdkAppID") != null && !jsonObj.get("sdkAppID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkAppID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkAppID").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkAppID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkAppID").toString())); } // validate the optional field sdkEncData if (jsonObj.get("sdkEncData") != null && !jsonObj.get("sdkEncData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkEncData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkEncData").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkEncData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkEncData").toString())); } // validate the optional field `sdkEphemPubKey` if (jsonObj.getAsJsonObject("sdkEphemPubKey") != null) { @@ -1680,23 +1686,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field sdkReferenceNumber if (jsonObj.get("sdkReferenceNumber") != null && !jsonObj.get("sdkReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkReferenceNumber").toString())); } // validate the optional field sdkTransID if (jsonObj.get("sdkTransID") != null && !jsonObj.get("sdkTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkTransID").toString())); } // validate the optional field sdkVersion if (jsonObj.get("sdkVersion") != null && !jsonObj.get("sdkVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `sdkVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sdkVersion").toString())); } // validate the optional field threeDSCompInd if (jsonObj.get("threeDSCompInd") != null && !jsonObj.get("threeDSCompInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSCompInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSCompInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSCompInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSCompInd").toString())); } // validate the optional field threeDSRequestorAuthenticationInd if (jsonObj.get("threeDSRequestorAuthenticationInd") != null && !jsonObj.get("threeDSRequestorAuthenticationInd").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorAuthenticationInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorAuthenticationInd").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorAuthenticationInd` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorAuthenticationInd").toString())); } // validate the optional field `threeDSRequestorAuthenticationInfo` if (jsonObj.getAsJsonObject("threeDSRequestorAuthenticationInfo") != null) { @@ -1711,11 +1717,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSRequestorID if (jsonObj.get("threeDSRequestorID") != null && !jsonObj.get("threeDSRequestorID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorID").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorID").toString())); } // validate the optional field threeDSRequestorName if (jsonObj.get("threeDSRequestorName") != null && !jsonObj.get("threeDSRequestorName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorName").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorName").toString())); } // validate the optional field `threeDSRequestorPriorAuthenticationInfo` if (jsonObj.getAsJsonObject("threeDSRequestorPriorAuthenticationInfo") != null) { @@ -1723,7 +1729,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSRequestorURL if (jsonObj.get("threeDSRequestorURL") != null && !jsonObj.get("threeDSRequestorURL").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSRequestorURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorURL").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSRequestorURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSRequestorURL").toString())); } // ensure the field transType can be parsed to an enum value if (jsonObj.get("transType") != null) { @@ -1741,7 +1747,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field whiteListStatus if (jsonObj.get("whiteListStatus") != null && !jsonObj.get("whiteListStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); } // validate the optional field `workPhone` if (jsonObj.getAsJsonObject("workPhone") != null) { diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2Result.java b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java index 647de1858..34dbb77ec 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -664,6 +666,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2Result.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -684,16 +690,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2Result.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2Result` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2Result` properties.", entry.getKey())); } } // validate the optional field authenticationValue if (jsonObj.get("authenticationValue") != null && !jsonObj.get("authenticationValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authenticationValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `authenticationValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticationValue").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // ensure the field challengeCancel can be parsed to an enum value if (jsonObj.get("challengeCancel") != null) { @@ -711,11 +717,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // ensure the field exemptionIndicator can be parsed to an enum value if (jsonObj.get("exemptionIndicator") != null) { @@ -726,31 +732,31 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field messageVersion if (jsonObj.get("messageVersion") != null && !jsonObj.get("messageVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `messageVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("messageVersion").toString())); } // validate the optional field riskScore if (jsonObj.get("riskScore") != null && !jsonObj.get("riskScore").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); } // validate the optional field threeDSServerTransID if (jsonObj.get("threeDSServerTransID") != null && !jsonObj.get("threeDSServerTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSServerTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSServerTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSServerTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSServerTransID").toString())); } // validate the optional field timestamp if (jsonObj.get("timestamp") != null && !jsonObj.get("timestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); + log.log(Level.WARNING, String.format("Expected the field `timestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("timestamp").toString())); } // validate the optional field transStatus if (jsonObj.get("transStatus") != null && !jsonObj.get("transStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatus").toString())); } // validate the optional field transStatusReason if (jsonObj.get("transStatusReason") != null && !jsonObj.get("transStatusReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); } // validate the optional field whiteListStatus if (jsonObj.get("whiteListStatus") != null && !jsonObj.get("whiteListStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `whiteListStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("whiteListStatus").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java index edad0e721..d92d73557 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("pspReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2ResultRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2ResultRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2ResultRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2ResultRequest` properties.", entry.getKey())); } } @@ -191,11 +197,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java index 3cca54dbe..b76fdb0f8 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDS2ResultResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDS2ResultResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2ResultResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDS2ResultResponse` properties.", entry.getKey())); } } // validate the optional field `threeDS2Result` diff --git a/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java index 1d1337549..6762445c0 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -241,6 +243,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSRequestorAuthenticationInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -261,12 +267,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSRequestorAuthenticationInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorAuthenticationInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorAuthenticationInfo` properties.", entry.getKey())); } } // validate the optional field threeDSReqAuthData if (jsonObj.get("threeDSReqAuthData") != null && !jsonObj.get("threeDSReqAuthData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthData").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthData").toString())); } // ensure the field threeDSReqAuthMethod can be parsed to an enum value if (jsonObj.get("threeDSReqAuthMethod") != null) { @@ -277,7 +283,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSReqAuthTimestamp if (jsonObj.get("threeDSReqAuthTimestamp") != null && !jsonObj.get("threeDSReqAuthTimestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthTimestamp").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqAuthTimestamp").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java index 14bf36733..da5d94ac9 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -266,6 +268,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSRequestorPriorAuthenticationInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -286,12 +292,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSRequestorPriorAuthenticationInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorPriorAuthenticationInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSRequestorPriorAuthenticationInfo` properties.", entry.getKey())); } } // validate the optional field threeDSReqPriorAuthData if (jsonObj.get("threeDSReqPriorAuthData") != null && !jsonObj.get("threeDSReqPriorAuthData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqPriorAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthData").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqPriorAuthData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthData").toString())); } // ensure the field threeDSReqPriorAuthMethod can be parsed to an enum value if (jsonObj.get("threeDSReqPriorAuthMethod") != null) { @@ -302,11 +308,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field threeDSReqPriorAuthTimestamp if (jsonObj.get("threeDSReqPriorAuthTimestamp") != null && !jsonObj.get("threeDSReqPriorAuthTimestamp").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqPriorAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthTimestamp").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqPriorAuthTimestamp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorAuthTimestamp").toString())); } // validate the optional field threeDSReqPriorRef if (jsonObj.get("threeDSReqPriorRef") != null && !jsonObj.get("threeDSReqPriorRef").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSReqPriorRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorRef").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSReqPriorRef` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSReqPriorRef").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/ThreeDSecureData.java b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java index a001e656d..23008884a 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -614,6 +616,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ThreeDSecureData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -634,7 +640,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ThreeDSecureData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ThreeDSecureData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ThreeDSecureData` properties.", entry.getKey())); } } // ensure the field authenticationResponse can be parsed to an enum value @@ -646,7 +652,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // ensure the field challengeCancel can be parsed to an enum value if (jsonObj.get("challengeCancel") != null) { @@ -664,23 +670,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // validate the optional field riskScore if (jsonObj.get("riskScore") != null && !jsonObj.get("riskScore").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); + log.log(Level.WARNING, String.format("Expected the field `riskScore` to be a primitive type in the JSON string but got `%s`", jsonObj.get("riskScore").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } // validate the optional field transStatusReason if (jsonObj.get("transStatusReason") != null && !jsonObj.get("transStatusReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `transStatusReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transStatusReason").toString())); } } diff --git a/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java index 241e523c6..0b82ed5cb 100644 --- a/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payment.JSON; @@ -443,6 +445,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(VoidPendingRefundRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -463,7 +469,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!VoidPendingRefundRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `VoidPendingRefundRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `VoidPendingRefundRequest` properties.", entry.getKey())); } } @@ -475,7 +481,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `modificationAmount` if (jsonObj.getAsJsonObject("modificationAmount") != null) { @@ -487,11 +493,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field originalMerchantReference if (jsonObj.get("originalMerchantReference") != null && !jsonObj.get("originalMerchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `originalMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalMerchantReference").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())); + log.log(Level.WARNING, 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 `platformChargebackLogic` if (jsonObj.getAsJsonObject("platformChargebackLogic") != null) { @@ -499,7 +505,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `reference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reference").toString())); } JsonArray jsonArraysplits = jsonObj.getAsJsonArray("splits"); if (jsonArraysplits != null) { @@ -515,11 +521,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/Address.java b/src/main/java/com/adyen/model/payout/Address.java index 41560a1ff..7b47398f3 100644 --- a/src/main/java/com/adyen/model/payout/Address.java +++ b/src/main/java/com/adyen/model/payout/Address.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -277,6 +279,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("postalCode"); openapiRequiredFields.add("street"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -297,7 +303,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } @@ -309,27 +315,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 houseNumberOrName if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/Amount.java b/src/main/java/com/adyen/model/payout/Amount.java index f279d2006..cb9e846f7 100644 --- a/src/main/java/com/adyen/model/payout/Amount.java +++ b/src/main/java/com/adyen/model/payout/Amount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/BankAccount.java b/src/main/java/com/adyen/model/payout/BankAccount.java index e7384c568..eef7b6ba7 100644 --- a/src/main/java/com/adyen/model/payout/BankAccount.java +++ b/src/main/java/com/adyen/model/payout/BankAccount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -359,6 +361,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -379,44 +385,44 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccount` properties.", entry.getKey())); } } // validate the optional field bankAccountNumber if (jsonObj.get("bankAccountNumber") != null && !jsonObj.get("bankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").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())); + log.log(Level.WARNING, 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 bankLocationId if (jsonObj.get("bankLocationId") != null && !jsonObj.get("bankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/Card.java b/src/main/java/com/adyen/model/payout/Card.java index d17b9a74d..05ef7b530 100644 --- a/src/main/java/com/adyen/model/payout/Card.java +++ b/src/main/java/com/adyen/model/payout/Card.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -330,6 +332,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Card.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -350,40 +356,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Card.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Card` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); } // validate the optional field issueNumber if (jsonObj.get("issueNumber") != null && !jsonObj.get("issueNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // validate the optional field startMonth if (jsonObj.get("startMonth") != null && !jsonObj.get("startMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); } // validate the optional field startYear if (jsonObj.get("startYear") != null && !jsonObj.get("startYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/FraudCheckResult.java b/src/main/java/com/adyen/model/payout/FraudCheckResult.java index ab96b96f4..6995a6657 100644 --- a/src/main/java/com/adyen/model/payout/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payout/FraudCheckResult.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("checkId"); openapiRequiredFields.add("name"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudCheckResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FraudCheckResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResult` properties.", entry.getKey())); } } @@ -220,7 +226,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java index b5c1a9d12..49ac42fa2 100644 --- a/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudCheckResultWrapper.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,7 +154,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudCheckResultWrapper` properties.", entry.getKey())); } } // validate the optional field `FraudCheckResult` diff --git a/src/main/java/com/adyen/model/payout/FraudResult.java b/src/main/java/com/adyen/model/payout/FraudResult.java index 5f810b037..ef3c55bbd 100644 --- a/src/main/java/com/adyen/model/payout/FraudResult.java +++ b/src/main/java/com/adyen/model/payout/FraudResult.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("accountScore"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FraudResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FraudResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FraudResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FraudResult` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/payout/FundSource.java b/src/main/java/com/adyen/model/payout/FundSource.java index df62b7db8..bd86c254a 100644 --- a/src/main/java/com/adyen/model/payout/FundSource.java +++ b/src/main/java/com/adyen/model/payout/FundSource.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -286,6 +288,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FundSource.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -306,7 +312,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!FundSource.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FundSource` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FundSource` properties.", entry.getKey())); } } // validate the optional field `billingAddress` @@ -319,7 +325,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -327,7 +333,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ModifyRequest.java b/src/main/java/com/adyen/model/payout/ModifyRequest.java index c70524002..27b9b6265 100644 --- a/src/main/java/com/adyen/model/payout/ModifyRequest.java +++ b/src/main/java/com/adyen/model/payout/ModifyRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -198,6 +200,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ModifyRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -218,7 +224,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ModifyRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModifyRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ModifyRequest` properties.", entry.getKey())); } } @@ -230,11 +236,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `originalReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("originalReference").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ModifyResponse.java b/src/main/java/com/adyen/model/payout/ModifyResponse.java index f96e09d57..5b3642c11 100644 --- a/src/main/java/com/adyen/model/payout/ModifyResponse.java +++ b/src/main/java/com/adyen/model/payout/ModifyResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -198,6 +200,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("response"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ModifyResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -218,7 +224,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ModifyResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModifyResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ModifyResponse` properties.", entry.getKey())); } } @@ -230,11 +236,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 response if (jsonObj.get("response") != null && !jsonObj.get("response").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); + log.log(Level.WARNING, String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/Name.java b/src/main/java/com/adyen/model/payout/Name.java index 9ec61da6b..2a40b9184 100644 --- a/src/main/java/com/adyen/model/payout/Name.java +++ b/src/main/java/com/adyen/model/payout/Name.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/PayoutRequest.java b/src/main/java/com/adyen/model/payout/PayoutRequest.java index de448805b..3b7930c4b 100644 --- a/src/main/java/com/adyen/model/payout/PayoutRequest.java +++ b/src/main/java/com/adyen/model/payout/PayoutRequest.java @@ -46,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -564,6 +566,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayoutRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -584,7 +590,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayoutRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayoutRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayoutRequest` properties.", entry.getKey())); } } @@ -612,7 +618,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -620,15 +626,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // ensure the field shopperInteraction can be parsed to an enum value if (jsonObj.get("shopperInteraction") != null) { @@ -643,11 +649,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/PayoutResponse.java b/src/main/java/com/adyen/model/payout/PayoutResponse.java index 735e0cdb6..ffd25b50d 100644 --- a/src/main/java/com/adyen/model/payout/PayoutResponse.java +++ b/src/main/java/com/adyen/model/payout/PayoutResponse.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -499,6 +501,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PayoutResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -519,12 +525,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PayoutResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PayoutResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PayoutResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 `dccAmount` if (jsonObj.getAsJsonObject("dccAmount") != null) { @@ -532,7 +538,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field dccSignature if (jsonObj.get("dccSignature") != null && !jsonObj.get("dccSignature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dccSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dccSignature").toString())); + log.log(Level.WARNING, String.format("Expected the field `dccSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dccSignature").toString())); } // validate the optional field `fraudResult` if (jsonObj.getAsJsonObject("fraudResult") != null) { @@ -540,23 +546,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field issuerUrl if (jsonObj.get("issuerUrl") != null && !jsonObj.get("issuerUrl").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerUrl").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerUrl").toString())); } // validate the optional field md if (jsonObj.get("md") != null && !jsonObj.get("md").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `md` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md").toString())); + log.log(Level.WARNING, String.format("Expected the field `md` to be a primitive type in the JSON string but got `%s`", jsonObj.get("md").toString())); } // validate the optional field paRequest if (jsonObj.get("paRequest") != null && !jsonObj.get("paRequest").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paRequest").toString())); + log.log(Level.WARNING, String.format("Expected the field `paRequest` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paRequest").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/payout/Recurring.java b/src/main/java/com/adyen/model/payout/Recurring.java index b9ef6f270..ce7b807f0 100644 --- a/src/main/java/com/adyen/model/payout/Recurring.java +++ b/src/main/java/com/adyen/model/payout/Recurring.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -340,6 +342,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Recurring.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -360,7 +366,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Recurring.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties.", entry.getKey())); } } // ensure the field contract can be parsed to an enum value @@ -372,11 +378,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringDetailName if (jsonObj.get("recurringDetailName") != null && !jsonObj.get("recurringDetailName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field tokenService can be parsed to an enum value if (jsonObj.get("tokenService") != null) { diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java index 7a03d5ef7..1c462144a 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -243,6 +245,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalData3DSecure.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -263,24 +269,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalData3DSecure.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalData3DSecure` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalData3DSecure` properties.", entry.getKey())); } } // validate the optional field cardHolderInfo if (jsonObj.get("cardHolderInfo") != null && !jsonObj.get("cardHolderInfo").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderInfo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderInfo").toString())); } // validate the optional field cavv if (jsonObj.get("cavv") != null && !jsonObj.get("cavv").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavv` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavv").toString())); } // validate the optional field cavvAlgorithm if (jsonObj.get("cavvAlgorithm") != null && !jsonObj.get("cavvAlgorithm").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); + log.log(Level.WARNING, String.format("Expected the field `cavvAlgorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cavvAlgorithm").toString())); } // validate the optional field scaExemptionRequested if (jsonObj.get("scaExemptionRequested") != null && !jsonObj.get("scaExemptionRequested").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `scaExemptionRequested` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemptionRequested").toString())); + log.log(Level.WARNING, String.format("Expected the field `scaExemptionRequested` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scaExemptionRequested").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java index 6470a2852..652b82390 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -272,6 +274,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataBillingAddress.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -292,32 +298,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataBillingAddress.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataBillingAddress` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataBillingAddress` properties.", entry.getKey())); } } // validate the optional field billingAddress.city if (jsonObj.get("billingAddress.city") != null && !jsonObj.get("billingAddress.city").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.city").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.city` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.city").toString())); } // validate the optional field billingAddress.country if (jsonObj.get("billingAddress.country") != null && !jsonObj.get("billingAddress.country").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.country").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.country").toString())); } // validate the optional field billingAddress.houseNumberOrName if (jsonObj.get("billingAddress.houseNumberOrName") != null && !jsonObj.get("billingAddress.houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.houseNumberOrName").toString())); } // validate the optional field billingAddress.postalCode if (jsonObj.get("billingAddress.postalCode") != null && !jsonObj.get("billingAddress.postalCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.postalCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.postalCode").toString())); } // validate the optional field billingAddress.stateOrProvince if (jsonObj.get("billingAddress.stateOrProvince") != null && !jsonObj.get("billingAddress.stateOrProvince").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.stateOrProvince").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.stateOrProvince").toString())); } // validate the optional field billingAddress.street if (jsonObj.get("billingAddress.street") != null && !jsonObj.get("billingAddress.street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingAddress.street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.street").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingAddress.street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingAddress.street").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java index 915118787..06fa4adcf 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -330,6 +332,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataCard.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -350,40 +356,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataCard.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCard` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCard` properties.", entry.getKey())); } } // validate the optional field cardBin if (jsonObj.get("cardBin") != null && !jsonObj.get("cardBin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardBin").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardBin").toString())); } // validate the optional field cardHolderName if (jsonObj.get("cardHolderName") != null && !jsonObj.get("cardHolderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardHolderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardHolderName").toString())); } // validate the optional field cardIssuingBank if (jsonObj.get("cardIssuingBank") != null && !jsonObj.get("cardIssuingBank").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingBank").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingBank` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingBank").toString())); } // validate the optional field cardIssuingCountry if (jsonObj.get("cardIssuingCountry") != null && !jsonObj.get("cardIssuingCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCountry").toString())); } // validate the optional field cardIssuingCurrency if (jsonObj.get("cardIssuingCurrency") != null && !jsonObj.get("cardIssuingCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardIssuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardIssuingCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardIssuingCurrency").toString())); } // validate the optional field cardPaymentMethod if (jsonObj.get("cardPaymentMethod") != null && !jsonObj.get("cardPaymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardPaymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardPaymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardPaymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardPaymentMethod").toString())); } // validate the optional field cardSummary if (jsonObj.get("cardSummary") != null && !jsonObj.get("cardSummary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cardSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardSummary").toString())); + log.log(Level.WARNING, String.format("Expected the field `cardSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardSummary").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())); + log.log(Level.WARNING, String.format("Expected the field `issuerBin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerBin").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java index 684599f3f..dc2888bb5 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -1905,6 +1907,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataCommon.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -1925,96 +1931,96 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataCommon.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCommon` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataCommon` properties.", entry.getKey())); } } // validate the optional field acquirerAccountCode if (jsonObj.get("acquirerAccountCode") != null && !jsonObj.get("acquirerAccountCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerAccountCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerAccountCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerAccountCode").toString())); } // validate the optional field acquirerCode if (jsonObj.get("acquirerCode") != null && !jsonObj.get("acquirerCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerCode").toString())); } // validate the optional field acquirerReference if (jsonObj.get("acquirerReference") != null && !jsonObj.get("acquirerReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `acquirerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `acquirerReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acquirerReference").toString())); } // validate the optional field alias if (jsonObj.get("alias") != null && !jsonObj.get("alias").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); + log.log(Level.WARNING, String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); } // validate the optional field aliasType if (jsonObj.get("aliasType") != null && !jsonObj.get("aliasType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").toString())); + log.log(Level.WARNING, String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").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())); + log.log(Level.WARNING, 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 authorisationMid if (jsonObj.get("authorisationMid") != null && !jsonObj.get("authorisationMid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisationMid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationMid").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisationMid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisationMid").toString())); } // validate the optional field authorisedAmountCurrency if (jsonObj.get("authorisedAmountCurrency") != null && !jsonObj.get("authorisedAmountCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisedAmountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisedAmountCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountCurrency").toString())); } // validate the optional field authorisedAmountValue if (jsonObj.get("authorisedAmountValue") != null && !jsonObj.get("authorisedAmountValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `authorisedAmountValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `authorisedAmountValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorisedAmountValue").toString())); } // validate the optional field avsResult if (jsonObj.get("avsResult") != null && !jsonObj.get("avsResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResult").toString())); } // validate the optional field avsResultRaw if (jsonObj.get("avsResultRaw") != null && !jsonObj.get("avsResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `avsResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("avsResultRaw").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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").toString())); } // validate the optional field coBrandedWith if (jsonObj.get("coBrandedWith") != null && !jsonObj.get("coBrandedWith").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `coBrandedWith` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coBrandedWith").toString())); + log.log(Level.WARNING, String.format("Expected the field `coBrandedWith` to be a primitive type in the JSON string but got `%s`", jsonObj.get("coBrandedWith").toString())); } // validate the optional field cvcResult if (jsonObj.get("cvcResult") != null && !jsonObj.get("cvcResult").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResult").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResult` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResult").toString())); } // validate the optional field cvcResultRaw if (jsonObj.get("cvcResultRaw") != null && !jsonObj.get("cvcResultRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `cvcResultRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cvcResultRaw").toString())); } // validate the optional field dsTransID if (jsonObj.get("dsTransID") != null && !jsonObj.get("dsTransID").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); + log.log(Level.WARNING, String.format("Expected the field `dsTransID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dsTransID").toString())); } // validate the optional field eci if (jsonObj.get("eci") != null && !jsonObj.get("eci").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); + log.log(Level.WARNING, String.format("Expected the field `eci` to be a primitive type in the JSON string but got `%s`", jsonObj.get("eci").toString())); } // validate the optional field expiryDate if (jsonObj.get("expiryDate") != null && !jsonObj.get("expiryDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryDate").toString())); } // validate the optional field extraCostsCurrency if (jsonObj.get("extraCostsCurrency") != null && !jsonObj.get("extraCostsCurrency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extraCostsCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsCurrency").toString())); + log.log(Level.WARNING, String.format("Expected the field `extraCostsCurrency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsCurrency").toString())); } // validate the optional field extraCostsValue if (jsonObj.get("extraCostsValue") != null && !jsonObj.get("extraCostsValue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `extraCostsValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsValue").toString())); + log.log(Level.WARNING, String.format("Expected the field `extraCostsValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("extraCostsValue").toString())); } // validate the optional field fraudCheck-[itemNr]-[FraudCheckname] if (jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]") != null && !jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fraudCheck-[itemNr]-[FraudCheckname]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").toString())); + log.log(Level.WARNING, String.format("Expected the field `fraudCheck-[itemNr]-[FraudCheckname]` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudCheck-[itemNr]-[FraudCheckname]").toString())); } // validate the optional field fraudManualReview if (jsonObj.get("fraudManualReview") != null && !jsonObj.get("fraudManualReview").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fraudManualReview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudManualReview").toString())); + log.log(Level.WARNING, String.format("Expected the field `fraudManualReview` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fraudManualReview").toString())); } // ensure the field fraudResultType can be parsed to an enum value if (jsonObj.get("fraudResultType") != null) { @@ -2025,87 +2031,87 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field fundingSource if (jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); + log.log(Level.WARNING, String.format("Expected the field `fundingSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); } // validate the optional field fundsAvailability 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())); + log.log(Level.WARNING, 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 inferredRefusalReason if (jsonObj.get("inferredRefusalReason") != null && !jsonObj.get("inferredRefusalReason").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `inferredRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inferredRefusalReason").toString())); + log.log(Level.WARNING, String.format("Expected the field `inferredRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inferredRefusalReason").toString())); } // validate the optional field isCardCommercial if (jsonObj.get("isCardCommercial") != null && !jsonObj.get("isCardCommercial").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `isCardCommercial` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isCardCommercial").toString())); + log.log(Level.WARNING, String.format("Expected the field `isCardCommercial` to be a primitive type in the JSON string but got `%s`", jsonObj.get("isCardCommercial").toString())); } // validate the optional field issuerCountry if (jsonObj.get("issuerCountry") != null && !jsonObj.get("issuerCountry").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); + log.log(Level.WARNING, String.format("Expected the field `issuerCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issuerCountry").toString())); } // validate the optional field liabilityShift if (jsonObj.get("liabilityShift") != null && !jsonObj.get("liabilityShift").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `liabilityShift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("liabilityShift").toString())); + log.log(Level.WARNING, String.format("Expected the field `liabilityShift` to be a primitive type in the JSON string but got `%s`", jsonObj.get("liabilityShift").toString())); } // validate the optional field mcBankNetReferenceNumber if (jsonObj.get("mcBankNetReferenceNumber") != null && !jsonObj.get("mcBankNetReferenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcBankNetReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcBankNetReferenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcBankNetReferenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcBankNetReferenceNumber").toString())); } // validate the optional field merchantAdviceCode if (jsonObj.get("merchantAdviceCode") != null && !jsonObj.get("merchantAdviceCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantAdviceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAdviceCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantAdviceCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAdviceCode").toString())); } // validate the optional field merchantReference if (jsonObj.get("merchantReference") != null && !jsonObj.get("merchantReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `merchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantReference").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field paymentAccountReference if (jsonObj.get("paymentAccountReference") != null && !jsonObj.get("paymentAccountReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentAccountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccountReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentAccountReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentAccountReference").toString())); } // validate the optional field paymentMethod if (jsonObj.get("paymentMethod") != null && !jsonObj.get("paymentMethod").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethod").toString())); } // validate the optional field paymentMethodVariant if (jsonObj.get("paymentMethodVariant") != null && !jsonObj.get("paymentMethodVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); } // validate the optional field payoutEligible if (jsonObj.get("payoutEligible") != null && !jsonObj.get("payoutEligible").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); + log.log(Level.WARNING, String.format("Expected the field `payoutEligible` to be a primitive type in the JSON string but got `%s`", jsonObj.get("payoutEligible").toString())); } // validate the optional field realtimeAccountUpdaterStatus if (jsonObj.get("realtimeAccountUpdaterStatus") != null && !jsonObj.get("realtimeAccountUpdaterStatus").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `realtimeAccountUpdaterStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realtimeAccountUpdaterStatus").toString())); + log.log(Level.WARNING, String.format("Expected the field `realtimeAccountUpdaterStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("realtimeAccountUpdaterStatus").toString())); } // validate the optional field receiptFreeText if (jsonObj.get("receiptFreeText") != null && !jsonObj.get("receiptFreeText").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `receiptFreeText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptFreeText").toString())); + log.log(Level.WARNING, String.format("Expected the field `receiptFreeText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("receiptFreeText").toString())); } // validate the optional field recurring.contractTypes if (jsonObj.get("recurring.contractTypes") != null && !jsonObj.get("recurring.contractTypes").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.contractTypes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.contractTypes").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.contractTypes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.contractTypes").toString())); } // validate the optional field recurring.firstPspReference if (jsonObj.get("recurring.firstPspReference") != null && !jsonObj.get("recurring.firstPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.firstPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.firstPspReference").toString())); } // validate the optional field recurring.recurringDetailReference if (jsonObj.get("recurring.recurringDetailReference") != null && !jsonObj.get("recurring.recurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.recurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.recurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.recurringDetailReference").toString())); } // validate the optional field recurring.shopperReference if (jsonObj.get("recurring.shopperReference") != null && !jsonObj.get("recurring.shopperReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurring.shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.shopperReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurring.shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurring.shopperReference").toString())); } // ensure the field recurringProcessingModel can be parsed to an enum value if (jsonObj.get("recurringProcessingModel") != null) { @@ -2116,59 +2122,59 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field referred if (jsonObj.get("referred") != null && !jsonObj.get("referred").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `referred` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referred").toString())); + log.log(Level.WARNING, String.format("Expected the field `referred` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referred").toString())); } // validate the optional field refusalReasonRaw if (jsonObj.get("refusalReasonRaw") != null && !jsonObj.get("refusalReasonRaw").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `refusalReasonRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonRaw").toString())); + log.log(Level.WARNING, String.format("Expected the field `refusalReasonRaw` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReasonRaw").toString())); } // validate the optional field requestAmount if (jsonObj.get("requestAmount") != null && !jsonObj.get("requestAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestAmount").toString())); } // validate the optional field requestCurrencyCode if (jsonObj.get("requestCurrencyCode") != null && !jsonObj.get("requestCurrencyCode").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `requestCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestCurrencyCode").toString())); + log.log(Level.WARNING, String.format("Expected the field `requestCurrencyCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestCurrencyCode").toString())); } // validate the optional field shopperInteraction if (jsonObj.get("shopperInteraction") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `shopperInteraction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperInteraction").toString())); } // 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())); + log.log(Level.WARNING, 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 terminalId if (jsonObj.get("terminalId") != null && !jsonObj.get("terminalId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); + log.log(Level.WARNING, String.format("Expected the field `terminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminalId").toString())); } // validate the optional field threeDAuthenticated if (jsonObj.get("threeDAuthenticated") != null && !jsonObj.get("threeDAuthenticated").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticated` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticated").toString())); } // validate the optional field threeDAuthenticatedResponse if (jsonObj.get("threeDAuthenticatedResponse") != null && !jsonObj.get("threeDAuthenticatedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDAuthenticatedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDAuthenticatedResponse").toString())); } // validate the optional field threeDOffered if (jsonObj.get("threeDOffered") != null && !jsonObj.get("threeDOffered").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOffered` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOffered").toString())); } // validate the optional field threeDOfferedResponse if (jsonObj.get("threeDOfferedResponse") != null && !jsonObj.get("threeDOfferedResponse").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDOfferedResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDOfferedResponse").toString())); } // validate the optional field threeDSVersion if (jsonObj.get("threeDSVersion") != null && !jsonObj.get("threeDSVersion").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); + log.log(Level.WARNING, String.format("Expected the field `threeDSVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("threeDSVersion").toString())); } // validate the optional field visaTransactionId if (jsonObj.get("visaTransactionId") != null && !jsonObj.get("visaTransactionId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `visaTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaTransactionId").toString())); + log.log(Level.WARNING, String.format("Expected the field `visaTransactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("visaTransactionId").toString())); } // validate the optional field xid if (jsonObj.get("xid") != null && !jsonObj.get("xid").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); + log.log(Level.WARNING, String.format("Expected the field `xid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("xid").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java index a34e3c411..9131ec0d1 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -446,6 +448,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataInstallments.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -466,56 +472,56 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataInstallments.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataInstallments` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataInstallments` properties.", entry.getKey())); } } // validate the optional field installmentPaymentData.installmentType if (jsonObj.get("installmentPaymentData.installmentType") != null && !jsonObj.get("installmentPaymentData.installmentType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.installmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.installmentType").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.installmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.installmentType").toString())); } // validate the optional field installmentPaymentData.option[itemNr].annualPercentageRate if (jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate") != null && !jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].annualPercentageRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].annualPercentageRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].annualPercentageRate").toString())); } // validate the optional field installmentPaymentData.option[itemNr].firstInstallmentAmount if (jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount") != null && !jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].firstInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].firstInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].firstInstallmentAmount").toString())); } // validate the optional field installmentPaymentData.option[itemNr].installmentFee if (jsonObj.get("installmentPaymentData.option[itemNr].installmentFee") != null && !jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].installmentFee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].installmentFee` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].installmentFee").toString())); } // validate the optional field installmentPaymentData.option[itemNr].interestRate if (jsonObj.get("installmentPaymentData.option[itemNr].interestRate") != null && !jsonObj.get("installmentPaymentData.option[itemNr].interestRate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].interestRate").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].interestRate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].interestRate").toString())); } // validate the optional field installmentPaymentData.option[itemNr].maximumNumberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].maximumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].maximumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].maximumNumberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].minimumNumberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].minimumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].minimumNumberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].minimumNumberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].numberOfInstallments if (jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments") != null && !jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].numberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].numberOfInstallments` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].numberOfInstallments").toString())); } // validate the optional field installmentPaymentData.option[itemNr].subsequentInstallmentAmount if (jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount") != null && !jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].subsequentInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].subsequentInstallmentAmount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].subsequentInstallmentAmount").toString())); } // validate the optional field installmentPaymentData.option[itemNr].totalAmountDue if (jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue") != null && !jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.option[itemNr].totalAmountDue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.option[itemNr].totalAmountDue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.option[itemNr].totalAmountDue").toString())); } // validate the optional field installmentPaymentData.paymentOptions if (jsonObj.get("installmentPaymentData.paymentOptions") != null && !jsonObj.get("installmentPaymentData.paymentOptions").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installmentPaymentData.paymentOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.paymentOptions").toString())); + log.log(Level.WARNING, String.format("Expected the field `installmentPaymentData.paymentOptions` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installmentPaymentData.paymentOptions").toString())); } // validate the optional field installments.value if (jsonObj.get("installments.value") != null && !jsonObj.get("installments.value").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `installments.value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installments.value").toString())); + log.log(Level.WARNING, String.format("Expected the field `installments.value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("installments.value").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java index abe1767dc..d83227a09 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataNetworkTokens.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataNetworkTokens.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataNetworkTokens` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataNetworkTokens` properties.", entry.getKey())); } } // validate the optional field networkToken.available if (jsonObj.get("networkToken.available") != null && !jsonObj.get("networkToken.available").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.available").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.available` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.available").toString())); } // validate the optional field networkToken.bin if (jsonObj.get("networkToken.bin") != null && !jsonObj.get("networkToken.bin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.bin").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.bin").toString())); } // validate the optional field networkToken.tokenSummary if (jsonObj.get("networkToken.tokenSummary") != null && !jsonObj.get("networkToken.tokenSummary").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkToken.tokenSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.tokenSummary").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkToken.tokenSummary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkToken.tokenSummary").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java index 43aca8683..83105ec76 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataOpi.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataOpi.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataOpi` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataOpi` properties.", entry.getKey())); } } // validate the optional field opi.transToken if (jsonObj.get("opi.transToken") != null && !jsonObj.get("opi.transToken").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `opi.transToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.transToken").toString())); + log.log(Level.WARNING, String.format("Expected the field `opi.transToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("opi.transToken").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java index 71058bb1a..a97dd8701 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResponseAdditionalDataSepa.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ResponseAdditionalDataSepa.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataSepa` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResponseAdditionalDataSepa` properties.", entry.getKey())); } } // validate the optional field sepadirectdebit.dateOfSignature if (jsonObj.get("sepadirectdebit.dateOfSignature") != null && !jsonObj.get("sepadirectdebit.dateOfSignature").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.dateOfSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.dateOfSignature").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.dateOfSignature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.dateOfSignature").toString())); } // validate the optional field sepadirectdebit.mandateId if (jsonObj.get("sepadirectdebit.mandateId") != null && !jsonObj.get("sepadirectdebit.mandateId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.mandateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.mandateId").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.mandateId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.mandateId").toString())); } // validate the optional field sepadirectdebit.sequenceType if (jsonObj.get("sepadirectdebit.sequenceType") != null && !jsonObj.get("sepadirectdebit.sequenceType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `sepadirectdebit.sequenceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.sequenceType").toString())); + log.log(Level.WARNING, String.format("Expected the field `sepadirectdebit.sequenceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sepadirectdebit.sequenceType").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/ServiceError.java b/src/main/java/com/adyen/model/payout/ServiceError.java index 19f772a54..1d4311b0c 100644 --- a/src/main/java/com/adyen/model/payout/ServiceError.java +++ b/src/main/java/com/adyen/model/payout/ServiceError.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -283,6 +285,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -303,24 +309,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java index 51685a38d..fee165962 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java @@ -50,6 +50,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -723,6 +725,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("shopperEmail"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreDetailAndSubmitRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -743,7 +749,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreDetailAndSubmitRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreDetailAndSubmitRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreDetailAndSubmitRequest` properties.", entry.getKey())); } } @@ -778,11 +784,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 nationality if (jsonObj.get("nationality") != null && !jsonObj.get("nationality").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); + log.log(Level.WARNING, String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); } // validate the optional field `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -790,15 +796,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedBrand if (jsonObj.get("selectedBrand") != null && !jsonObj.get("selectedBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -806,19 +812,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java index 02163ed69..a4cc61d82 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -227,6 +229,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("resultCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreDetailAndSubmitResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -247,7 +253,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreDetailAndSubmitResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreDetailAndSubmitResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreDetailAndSubmitResponse` properties.", entry.getKey())); } } @@ -259,15 +265,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); } // validate the optional field resultCode if (jsonObj.get("resultCode") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java index 2c3dd37c8..827ea52ca 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java @@ -49,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -633,6 +635,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("shopperEmail"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreDetailRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -653,7 +659,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreDetailRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreDetailRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreDetailRequest` properties.", entry.getKey())); } } @@ -684,11 +690,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 nationality if (jsonObj.get("nationality") != null && !jsonObj.get("nationality").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); + log.log(Level.WARNING, String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); } // validate the optional field `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -696,11 +702,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field selectedBrand if (jsonObj.get("selectedBrand") != null && !jsonObj.get("selectedBrand").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedBrand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedBrand").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -708,15 +714,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } // validate the optional field telephoneNumber if (jsonObj.get("telephoneNumber") != null && !jsonObj.get("telephoneNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `telephoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("telephoneNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/StoreDetailResponse.java b/src/main/java/com/adyen/model/payout/StoreDetailResponse.java index 47970320a..aa3eb0ef9 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailResponse.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -228,6 +230,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("recurringDetailReference"); openapiRequiredFields.add("resultCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoreDetailResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -248,7 +254,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!StoreDetailResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `StoreDetailResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoreDetailResponse` properties.", entry.getKey())); } } @@ -260,15 +266,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 resultCode if (jsonObj.get("resultCode") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/SubmitRequest.java b/src/main/java/com/adyen/model/payout/SubmitRequest.java index 71364bc26..3c3a5d765 100644 --- a/src/main/java/com/adyen/model/payout/SubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/SubmitRequest.java @@ -47,6 +47,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -602,6 +604,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("shopperEmail"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubmitRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -622,7 +628,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SubmitRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubmitRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubmitRequest` properties.", entry.getKey())); } } @@ -645,11 +651,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 nationality if (jsonObj.get("nationality") != null && !jsonObj.get("nationality").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); + log.log(Level.WARNING, String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); } // validate the optional field `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -657,15 +663,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // validate the optional field shopperEmail if (jsonObj.get("shopperEmail") != null && !jsonObj.get("shopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperEmail").toString())); } // validate the optional field `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -673,15 +679,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 shopperStatement if (jsonObj.get("shopperStatement") != null && !jsonObj.get("shopperStatement").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperStatement` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperStatement").toString())); } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } } diff --git a/src/main/java/com/adyen/model/payout/SubmitResponse.java b/src/main/java/com/adyen/model/payout/SubmitResponse.java index 7384a9db8..312b4a2e8 100644 --- a/src/main/java/com/adyen/model/payout/SubmitResponse.java +++ b/src/main/java/com/adyen/model/payout/SubmitResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.payout.JSON; @@ -227,6 +229,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("resultCode"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SubmitResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -247,7 +253,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!SubmitResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SubmitResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SubmitResponse` properties.", entry.getKey())); } } @@ -259,15 +265,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `refusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refusalReason").toString())); } // validate the optional field resultCode if (jsonObj.get("resultCode") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/Address.java b/src/main/java/com/adyen/model/posterminalmanagement/Address.java index e45cf69d7..58beb6d9d 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/Address.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/Address.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,32 +299,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `streetAddress2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("streetAddress2").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java index 116f61983..d8d7b9987 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -253,6 +255,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("companyAccount"); openapiRequiredFields.add("terminals"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AssignTerminalsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -273,7 +279,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AssignTerminalsRequest` properties.", entry.getKey())); } } @@ -285,19 +291,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `terminals` to be an array in the JSON string but got `%s`", jsonObj.get("terminals").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java index e8ecf082a..f298e3c8c 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("results"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AssignTerminalsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,7 +163,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AssignTerminalsResponse` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java index e1cf39e19..009b7872a 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("terminal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FindTerminalRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FindTerminalRequest` properties.", entry.getKey())); } } @@ -161,7 +167,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java index 94abae9f7..bf814ec3c 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -246,6 +248,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("companyAccount"); openapiRequiredFields.add("terminal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(FindTerminalResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -266,7 +272,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `FindTerminalResponse` properties.", entry.getKey())); } } @@ -278,19 +284,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java index da8d837d2..9d5e54659 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("companyAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetStoresUnderAccountRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetStoresUnderAccountRequest` properties.", entry.getKey())); } } @@ -190,11 +196,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java index 42ba1401e..2243c8a29 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -139,6 +141,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetStoresUnderAccountResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -159,7 +165,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetStoresUnderAccountResponse` properties.", entry.getKey())); } } JsonArray jsonArraystores = jsonObj.getAsJsonArray("stores"); diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java index d20cd8c32..fff438a90 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("terminal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTerminalDetailsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTerminalDetailsRequest` properties.", entry.getKey())); } } @@ -161,7 +167,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `terminal` to be a primitive type in the JSON string but got `%s`", jsonObj.get("terminal").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java index b15e54713..42eab77b0 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -895,6 +897,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("companyAccount"); openapiRequiredFields.add("terminal"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTerminalDetailsResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -915,7 +921,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTerminalDetailsResponse` properties.", entry.getKey())); } } @@ -927,67 +933,67 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -995,7 +1001,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -1006,11 +1012,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `wifiMac` to be a primitive type in the JSON string but got `%s`", jsonObj.get("wifiMac").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java index a2b6625d6..92c701a9b 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("companyAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTerminalsUnderAccountRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTerminalsUnderAccountRequest` properties.", entry.getKey())); } } @@ -219,15 +225,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java index 014f95ec1..35f92d6a5 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -206,6 +208,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("companyAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(GetTerminalsUnderAccountResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -226,7 +232,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `GetTerminalsUnderAccountResponse` properties.", entry.getKey())); } } @@ -238,11 +244,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java b/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java index 237d6d0da..004107517 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -243,6 +245,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("merchantAccount"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -263,7 +269,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantAccount` properties.", entry.getKey())); } } @@ -275,15 +281,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java b/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java index 658607d49..e1e329fb9 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -244,6 +246,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -264,24 +270,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/posterminalmanagement/Store.java b/src/main/java/com/adyen/model/posterminalmanagement/Store.java index ddd939ebd..0e0c183af 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/Store.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/Store.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.posterminalmanagement.JSON; @@ -285,6 +287,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("store"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Store.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -305,7 +311,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Store` properties.", entry.getKey())); } } @@ -321,23 +327,23 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/Address.java b/src/main/java/com/adyen/model/recurring/Address.java index 5780509a7..4ce52fa89 100644 --- a/src/main/java/com/adyen/model/recurring/Address.java +++ b/src/main/java/com/adyen/model/recurring/Address.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -278,6 +280,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("postalCode"); openapiRequiredFields.add("street"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -298,7 +304,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); } } @@ -310,27 +316,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 houseNumberOrName if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 street if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/Amount.java b/src/main/java/com/adyen/model/recurring/Amount.java index 5118e6efe..7195b5569 100644 --- a/src/main/java/com/adyen/model/recurring/Amount.java +++ b/src/main/java/com/adyen/model/recurring/Amount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/BankAccount.java b/src/main/java/com/adyen/model/recurring/BankAccount.java index 62097a47e..8c05d0f82 100644 --- a/src/main/java/com/adyen/model/recurring/BankAccount.java +++ b/src/main/java/com/adyen/model/recurring/BankAccount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -360,6 +362,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -380,44 +386,44 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccount` properties.", entry.getKey())); } } // validate the optional field bankAccountNumber if (jsonObj.get("bankAccountNumber") != null && !jsonObj.get("bankAccountNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankAccountNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankAccountNumber").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())); + log.log(Level.WARNING, 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 bankLocationId if (jsonObj.get("bankLocationId") != null && !jsonObj.get("bankLocationId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").toString())); + log.log(Level.WARNING, String.format("Expected the field `bankLocationId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bankLocationId").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `bic` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bic").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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `iban` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iban").toString())); } // validate the optional field ownerName if (jsonObj.get("ownerName") != null && !jsonObj.get("ownerName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); + log.log(Level.WARNING, String.format("Expected the field `ownerName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ownerName").toString())); } // validate the optional field taxId if (jsonObj.get("taxId") != null && !jsonObj.get("taxId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); + log.log(Level.WARNING, String.format("Expected the field `taxId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("taxId").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/Card.java b/src/main/java/com/adyen/model/recurring/Card.java index 744b7dc29..c9c62f046 100644 --- a/src/main/java/com/adyen/model/recurring/Card.java +++ b/src/main/java/com/adyen/model/recurring/Card.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -331,6 +333,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Card.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -351,40 +357,40 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Card.openapiFields.contains(entry.getKey())) { - 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Card` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 expiryMonth if (jsonObj.get("expiryMonth") != null && !jsonObj.get("expiryMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryMonth").toString())); } // validate the optional field expiryYear if (jsonObj.get("expiryYear") != null && !jsonObj.get("expiryYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `expiryYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expiryYear").toString())); } // validate the optional field holderName if (jsonObj.get("holderName") != null && !jsonObj.get("holderName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); + log.log(Level.WARNING, String.format("Expected the field `holderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("holderName").toString())); } // validate the optional field issueNumber if (jsonObj.get("issueNumber") != null && !jsonObj.get("issueNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `issueNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("issueNumber").toString())); } // validate the optional field number if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); } // validate the optional field startMonth if (jsonObj.get("startMonth") != null && !jsonObj.get("startMonth").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); + log.log(Level.WARNING, String.format("Expected the field `startMonth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startMonth").toString())); } // validate the optional field startYear if (jsonObj.get("startYear") != null && !jsonObj.get("startYear").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); + log.log(Level.WARNING, String.format("Expected the field `startYear` to be a primitive type in the JSON string but got `%s`", jsonObj.get("startYear").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java index af5977e5e..e0a24435f 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -227,6 +229,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("recurringDetailReference"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePermitRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -247,7 +253,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePermitRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePermitRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePermitRequest` properties.", entry.getKey())); } } @@ -259,7 +265,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `merchantAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantAccount").toString())); } JsonArray jsonArraypermits = jsonObj.getAsJsonArray("permits"); if (jsonArraypermits != null) { @@ -275,11 +281,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java index ee400416f..6d9ceb8b9 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CreatePermitResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CreatePermitResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CreatePermitResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CreatePermitResult` properties.", entry.getKey())); } } JsonArray jsonArraypermitResultList = jsonObj.getAsJsonArray("permitResultList"); @@ -205,7 +211,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java index 3da2bf98d..16603f7de 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("token"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DisablePermitRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DisablePermitRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DisablePermitRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DisablePermitRequest` properties.", entry.getKey())); } } @@ -191,11 +197,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 token if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + log.log(Level.WARNING, String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java index ad8c8d793..404ec5ec1 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DisablePermitResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,16 +183,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DisablePermitResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DisablePermitResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DisablePermitResult` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `status` to be a primitive type in the JSON string but got `%s`", jsonObj.get("status").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/DisableRequest.java b/src/main/java/com/adyen/model/recurring/DisableRequest.java index 74302b217..914ce8ea1 100644 --- a/src/main/java/com/adyen/model/recurring/DisableRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisableRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -217,6 +219,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DisableRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -237,7 +243,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DisableRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DisableRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DisableRequest` properties.", entry.getKey())); } } @@ -249,19 +255,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field contract if (jsonObj.get("contract") != null && !jsonObj.get("contract").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `contract` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contract").toString())); + log.log(Level.WARNING, String.format("Expected the field `contract` to be a primitive type in the JSON string but got `%s`", jsonObj.get("contract").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/DisableResult.java b/src/main/java/com/adyen/model/recurring/DisableResult.java index b5b0d27d6..a688ecfa0 100644 --- a/src/main/java/com/adyen/model/recurring/DisableResult.java +++ b/src/main/java/com/adyen/model/recurring/DisableResult.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -128,6 +130,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DisableResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -148,12 +154,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!DisableResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DisableResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DisableResult` properties.", entry.getKey())); } } // validate the optional field response if (jsonObj.get("response") != null && !jsonObj.get("response").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); + log.log(Level.WARNING, String.format("Expected the field `response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/Name.java b/src/main/java/com/adyen/model/recurring/Name.java index f9c33f0b3..eae8c7275 100644 --- a/src/main/java/com/adyen/model/recurring/Name.java +++ b/src/main/java/com/adyen/model/recurring/Name.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("firstName"); openapiRequiredFields.add("lastName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); } } @@ -191,11 +197,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java index f38c10fbc..563d87d2a 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -365,6 +367,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NotifyShopperRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -385,7 +391,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!NotifyShopperRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotifyShopperRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NotifyShopperRequest` properties.", entry.getKey())); } } @@ -401,35 +407,35 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field billingDate if (jsonObj.get("billingDate") != null && !jsonObj.get("billingDate").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingDate").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingDate").toString())); } // validate the optional field billingSequenceNumber if (jsonObj.get("billingSequenceNumber") != null && !jsonObj.get("billingSequenceNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `billingSequenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingSequenceNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `billingSequenceNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("billingSequenceNumber").toString())); } // validate the optional field displayedReference if (jsonObj.get("displayedReference") != null && !jsonObj.get("displayedReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayedReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayedReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `displayedReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayedReference").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java index 23b2e91de..2ec7dfd7d 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -302,6 +304,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NotifyShopperResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -322,36 +328,36 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!NotifyShopperResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NotifyShopperResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NotifyShopperResult` properties.", entry.getKey())); } } // validate the optional field displayedReference if (jsonObj.get("displayedReference") != null && !jsonObj.get("displayedReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `displayedReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayedReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `displayedReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayedReference").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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 resultCode if (jsonObj.get("resultCode") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `resultCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultCode").toString())); } // validate the optional field shopperNotificationReference if (jsonObj.get("shopperNotificationReference") != null && !jsonObj.get("shopperNotificationReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `shopperNotificationReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperNotificationReference").toString())); } // validate the optional field storedPaymentMethodId if (jsonObj.get("storedPaymentMethodId") != null && !jsonObj.get("storedPaymentMethodId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); + log.log(Level.WARNING, String.format("Expected the field `storedPaymentMethodId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("storedPaymentMethodId").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/Permit.java b/src/main/java/com/adyen/model/recurring/Permit.java index e9610bae1..71593679c 100644 --- a/src/main/java/com/adyen/model/recurring/Permit.java +++ b/src/main/java/com/adyen/model/recurring/Permit.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -246,6 +248,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Permit.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -266,16 +272,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Permit.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Permit` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Permit` properties.", entry.getKey())); } } // validate the optional field partnerId if (jsonObj.get("partnerId") != null && !jsonObj.get("partnerId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `partnerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("partnerId").toString())); + log.log(Level.WARNING, String.format("Expected the field `partnerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("partnerId").toString())); } // validate the optional field profileReference if (jsonObj.get("profileReference") != null && !jsonObj.get("profileReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `profileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profileReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `profileReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("profileReference").toString())); } // validate the optional field `restriction` if (jsonObj.getAsJsonObject("restriction") != null) { @@ -283,7 +289,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field resultKey if (jsonObj.get("resultKey") != null && !jsonObj.get("resultKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resultKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `resultKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultKey").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/PermitRestriction.java b/src/main/java/com/adyen/model/recurring/PermitRestriction.java index fa4fbdd59..9e6656097 100644 --- a/src/main/java/com/adyen/model/recurring/PermitRestriction.java +++ b/src/main/java/com/adyen/model/recurring/PermitRestriction.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -187,6 +189,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PermitRestriction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -207,7 +213,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PermitRestriction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PermitRestriction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PermitRestriction` properties.", entry.getKey())); } } // validate the optional field `maxAmount` diff --git a/src/main/java/com/adyen/model/recurring/PermitResult.java b/src/main/java/com/adyen/model/recurring/PermitResult.java index 23135fa4c..60727f861 100644 --- a/src/main/java/com/adyen/model/recurring/PermitResult.java +++ b/src/main/java/com/adyen/model/recurring/PermitResult.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PermitResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,16 +183,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PermitResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PermitResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PermitResult` properties.", entry.getKey())); } } // validate the optional field resultKey if (jsonObj.get("resultKey") != null && !jsonObj.get("resultKey").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `resultKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultKey").toString())); + log.log(Level.WARNING, String.format("Expected the field `resultKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resultKey").toString())); } // validate the optional field token if (jsonObj.get("token") != null && !jsonObj.get("token").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + log.log(Level.WARNING, String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/Recurring.java b/src/main/java/com/adyen/model/recurring/Recurring.java index 1501dc994..67e5c12b4 100644 --- a/src/main/java/com/adyen/model/recurring/Recurring.java +++ b/src/main/java/com/adyen/model/recurring/Recurring.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -341,6 +343,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Recurring.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -361,7 +367,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Recurring.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Recurring` properties.", entry.getKey())); } } // ensure the field contract can be parsed to an enum value @@ -373,11 +379,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field recurringDetailName if (jsonObj.get("recurringDetailName") != null && !jsonObj.get("recurringDetailName").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringDetailName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringDetailName").toString())); } // validate the optional field recurringFrequency if (jsonObj.get("recurringFrequency") != null && !jsonObj.get("recurringFrequency").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); + log.log(Level.WARNING, String.format("Expected the field `recurringFrequency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recurringFrequency").toString())); } // ensure the field tokenService can be parsed to an enum value if (jsonObj.get("tokenService") != null) { diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetail.java b/src/main/java/com/adyen/model/recurring/RecurringDetail.java index 517a54a3d..003d4bb41 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetail.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetail.java @@ -51,6 +51,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -620,6 +622,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("recurringDetailReference"); openapiRequiredFields.add("variant"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RecurringDetail.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -640,7 +646,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RecurringDetail.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecurringDetail` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RecurringDetail` properties.", entry.getKey())); } } @@ -652,11 +658,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field alias if (jsonObj.get("alias") != null && !jsonObj.get("alias").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); + log.log(Level.WARNING, String.format("Expected the field `alias` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alias").toString())); } // validate the optional field aliasType if (jsonObj.get("aliasType") != null && !jsonObj.get("aliasType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").toString())); + log.log(Level.WARNING, String.format("Expected the field `aliasType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("aliasType").toString())); } // validate the optional field `bank` if (jsonObj.getAsJsonObject("bank") != null) { @@ -672,27 +678,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // ensure the json data is an array if (jsonObj.get("contractTypes") != null && !jsonObj.get("contractTypes").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `contractTypes` to be an array in the JSON string but got `%s`", jsonObj.get("contractTypes").toString())); + log.log(Level.WARNING, String.format("Expected the field `contractTypes` to be an array in the JSON string but got `%s`", jsonObj.get("contractTypes").toString())); } // validate the optional field firstPspReference if (jsonObj.get("firstPspReference") != null && !jsonObj.get("firstPspReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstPspReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `firstPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("firstPspReference").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field networkTxReference if (jsonObj.get("networkTxReference") != null && !jsonObj.get("networkTxReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `networkTxReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("networkTxReference").toString())); } // validate the optional field paymentMethodVariant if (jsonObj.get("paymentMethodVariant") != null && !jsonObj.get("paymentMethodVariant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").toString())); + log.log(Level.WARNING, String.format("Expected the field `paymentMethodVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMethodVariant").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())); + log.log(Level.WARNING, 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 `shopperName` if (jsonObj.getAsJsonObject("shopperName") != null) { @@ -700,7 +706,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field socialSecurityNumber if (jsonObj.get("socialSecurityNumber") != null && !jsonObj.get("socialSecurityNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `socialSecurityNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("socialSecurityNumber").toString())); } // validate the optional field `tokenDetails` if (jsonObj.getAsJsonObject("tokenDetails") != null) { @@ -708,7 +714,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field variant if (jsonObj.get("variant") != null && !jsonObj.get("variant").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `variant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("variant").toString())); + log.log(Level.WARNING, String.format("Expected the field `variant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("variant").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java index e58c82ec3..a16f1170e 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -129,6 +131,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RecurringDetailWrapper.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -149,7 +155,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RecurringDetailWrapper` properties.", entry.getKey())); } } // validate the optional field `RecurringDetail` diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java index 2c452000e..b44ddcc10 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -189,6 +191,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("shopperReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RecurringDetailsRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -209,7 +215,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RecurringDetailsRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecurringDetailsRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RecurringDetailsRequest` properties.", entry.getKey())); } } @@ -221,7 +227,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 `recurring` if (jsonObj.getAsJsonObject("recurring") != null) { @@ -229,7 +235,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java index 70a49a753..4aa049d4d 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -227,6 +229,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RecurringDetailsResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -247,7 +253,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!RecurringDetailsResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `RecurringDetailsResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RecurringDetailsResult` properties.", entry.getKey())); } } JsonArray jsonArraydetails = jsonObj.getAsJsonArray("details"); @@ -264,11 +270,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field lastKnownShopperEmail if (jsonObj.get("lastKnownShopperEmail") != null && !jsonObj.get("lastKnownShopperEmail").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `lastKnownShopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastKnownShopperEmail").toString())); + log.log(Level.WARNING, String.format("Expected the field `lastKnownShopperEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastKnownShopperEmail").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java index 78bbaee58..3a33cf993 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -287,6 +289,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ScheduleAccountUpdaterRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -307,7 +313,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ScheduleAccountUpdaterRequest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScheduleAccountUpdaterRequest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ScheduleAccountUpdaterRequest` properties.", entry.getKey())); } } @@ -323,19 +329,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 selectedRecurringDetailReference if (jsonObj.get("selectedRecurringDetailReference") != null && !jsonObj.get("selectedRecurringDetailReference").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); + log.log(Level.WARNING, String.format("Expected the field `selectedRecurringDetailReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("selectedRecurringDetailReference").toString())); } // 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())); + log.log(Level.WARNING, String.format("Expected the field `shopperReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shopperReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java index f0c0de60b..5faf33f33 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("pspReference"); openapiRequiredFields.add("result"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ScheduleAccountUpdaterResult.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!ScheduleAccountUpdaterResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScheduleAccountUpdaterResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ScheduleAccountUpdaterResult` properties.", entry.getKey())); } } @@ -191,11 +197,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 result if (jsonObj.get("result") != null && !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())); + log.log(Level.WARNING, String.format("Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/ServiceError.java b/src/main/java/com/adyen/model/recurring/ServiceError.java index f833159cd..58eb574b8 100644 --- a/src/main/java/com/adyen/model/recurring/ServiceError.java +++ b/src/main/java/com/adyen/model/recurring/ServiceError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -284,6 +286,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -304,24 +310,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/recurring/TokenDetails.java b/src/main/java/com/adyen/model/recurring/TokenDetails.java index 2f04aa89d..62f4d269a 100644 --- a/src/main/java/com/adyen/model/recurring/TokenDetails.java +++ b/src/main/java/com/adyen/model/recurring/TokenDetails.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.recurring.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TokenDetails.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,12 +194,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TokenDetails.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TokenDetails` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TokenDetails` properties.", entry.getKey())); } } // validate the optional field tokenDataType if (jsonObj.get("tokenDataType") != null && !jsonObj.get("tokenDataType").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `tokenDataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenDataType").toString())); + log.log(Level.WARNING, String.format("Expected the field `tokenDataType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenDataType").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/Amount.java b/src/main/java/com/adyen/model/storedvalue/Amount.java index ef2799618..12c16ae5b 100644 --- a/src/main/java/com/adyen/model/storedvalue/Amount.java +++ b/src/main/java/com/adyen/model/storedvalue/Amount.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -159,6 +161,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -179,7 +185,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -191,7 +197,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/ServiceError.java b/src/main/java/com/adyen/model/storedvalue/ServiceError.java index b01746dd1..2fa7f9492 100644 --- a/src/main/java/com/adyen/model/storedvalue/ServiceError.java +++ b/src/main/java/com/adyen/model/storedvalue/ServiceError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -284,6 +286,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -304,24 +310,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ServiceError` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `pspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspReference").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java index f233e5209..eb99ae3df 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -394,6 +396,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("paymentMethod"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueBalanceCheckRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -414,7 +420,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceCheckRequest` properties.", entry.getKey())); } } @@ -430,15 +436,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -449,11 +455,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java index 8fe4aa60d..4bfe679f3 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -296,6 +298,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueBalanceCheckResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -316,7 +322,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceCheckResponse` properties.", entry.getKey())); } } // validate the optional field `currentBalance` @@ -325,11 +331,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -340,7 +346,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java index 12d4a5c5e..21f4cf17d 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -429,6 +431,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("sourcePaymentMethod"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueBalanceMergeRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -449,7 +455,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceMergeRequest` properties.", entry.getKey())); } } @@ -465,15 +471,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -484,11 +490,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java index e496d8933..ebda7ee95 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -325,6 +327,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueBalanceMergeResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -345,12 +351,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueBalanceMergeResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { @@ -358,11 +364,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java index 5b08ae046..c23af062c 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -394,6 +396,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("paymentMethod"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueIssueRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -414,7 +420,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueIssueRequest` properties.", entry.getKey())); } } @@ -430,15 +436,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -449,11 +455,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java index 1e99c014a..38dc9d180 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -365,6 +367,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueIssueResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -385,12 +391,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueIssueResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { @@ -398,11 +404,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -413,7 +419,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java index c6c96c958..69d949118 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -471,6 +473,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("paymentMethod"); openapiRequiredFields.add("reference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueLoadRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -491,7 +497,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueLoadRequest` properties.", entry.getKey())); } } @@ -514,15 +520,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -533,11 +539,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java index db4803806..3ae589f5f 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -325,6 +327,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueLoadResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -345,12 +351,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueLoadResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { @@ -358,11 +364,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java index 533d2082b..12b788066 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java @@ -45,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -471,6 +473,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("reference"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueStatusChangeRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -491,7 +497,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueStatusChangeRequest` properties.", entry.getKey())); } } @@ -507,15 +513,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -526,7 +532,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -537,7 +543,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `store` to be a primitive type in the JSON string but got `%s`", jsonObj.get("store").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java index 25be90e49..c7e9d29d9 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -325,6 +327,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueStatusChangeResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -345,12 +351,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueStatusChangeResponse` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { @@ -358,11 +364,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java index e4c991e66..f48dfa277 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -275,6 +277,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("merchantAccount"); openapiRequiredFields.add("originalReference"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueVoidRequest.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -295,7 +301,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueVoidRequest` properties.", entry.getKey())); } } @@ -307,27 +313,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `uniqueTerminalId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uniqueTerminalId").toString())); } } diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java index 0df602c68..3bbff1b00 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.storedvalue.JSON; @@ -296,6 +298,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(StoredValueVoidResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -316,7 +322,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `StoredValueVoidResponse` properties.", entry.getKey())); } } // validate the optional field `currentBalance` @@ -325,11 +331,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { @@ -340,7 +346,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `thirdPartyRefusalReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("thirdPartyRefusalReason").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java index eaebc884a..7e31d2e4a 100644 --- a/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bsbCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AULocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AULocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java index 4eeacc1b5..1242f4197 100644 --- a/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalBankIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,12 +229,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalBankIdentification` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/Address2.java b/src/main/java/com/adyen/model/transfers/Address2.java index bd6ed7bcf..0c802b7fc 100644 --- a/src/main/java/com/adyen/model/transfers/Address2.java +++ b/src/main/java/com/adyen/model/transfers/Address2.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -273,6 +275,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("country"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address2.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -293,7 +299,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address2` properties.", entry.getKey())); } } @@ -305,27 +311,27 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 line1 if (jsonObj.get("line1") != null && !jsonObj.get("line1").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); + log.log(Level.WARNING, String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); } // validate the optional field line2 if (jsonObj.get("line2") != null && !jsonObj.get("line2").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); + log.log(Level.WARNING, String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateOrProvince").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/Amount.java b/src/main/java/com/adyen/model/transfers/Amount.java index 7f99642e5..2194ca085 100644 --- a/src/main/java/com/adyen/model/transfers/Amount.java +++ b/src/main/java/com/adyen/model/transfers/Amount.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -158,6 +160,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("currency"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -178,7 +184,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); } } @@ -190,7 +196,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java index 514a848f8..543be08cf 100644 --- a/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BRLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -263,6 +265,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("branchNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BRLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -283,7 +289,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BRLocalAccountIdentification.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BRLocalAccountIdentification` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BRLocalAccountIdentification` properties.", entry.getKey())); } } @@ -295,15 +301,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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 branchNumber if (jsonObj.get("branchNumber") != null && !jsonObj.get("branchNumber").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `branchNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branchNumber").toString())); + log.log(Level.WARNING, String.format("Expected the field `branchNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branchNumber").toString())); } // 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/transfers/BankAccountV3.java b/src/main/java/com/adyen/model/transfers/BankAccountV3.java index 73367ed8e..364c25a68 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -160,6 +162,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountHolder"); openapiRequiredFields.add("accountIdentification"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccountV3.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -180,7 +186,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!BankAccountV3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BankAccountV3` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccountV3` properties.", entry.getKey())); } } diff --git a/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java b/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java index f7cbafb5e..d08cade45 100644 --- a/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/BankAccountV3AccountIdentification.java @@ -784,6 +784,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { ArrayList errorMessages = new ArrayList<>(); // validate the json string with AULocalAccountIdentification try { + Logger.getLogger(AULocalAccountIdentification.class.getName()).setLevel(Level.OFF); AULocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -792,6 +793,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with BRLocalAccountIdentification try { + Logger.getLogger(BRLocalAccountIdentification.class.getName()).setLevel(Level.OFF); BRLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -800,6 +802,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CALocalAccountIdentification try { + Logger.getLogger(CALocalAccountIdentification.class.getName()).setLevel(Level.OFF); CALocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -808,6 +811,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with CZLocalAccountIdentification try { + Logger.getLogger(CZLocalAccountIdentification.class.getName()).setLevel(Level.OFF); CZLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -816,6 +820,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with DKLocalAccountIdentification try { + Logger.getLogger(DKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); DKLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -824,6 +829,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with HULocalAccountIdentification try { + Logger.getLogger(HULocalAccountIdentification.class.getName()).setLevel(Level.OFF); HULocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -832,6 +838,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with IbanAccountIdentification try { + Logger.getLogger(IbanAccountIdentification.class.getName()).setLevel(Level.OFF); IbanAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -840,6 +847,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with NOLocalAccountIdentification try { + Logger.getLogger(NOLocalAccountIdentification.class.getName()).setLevel(Level.OFF); NOLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -848,6 +856,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with NumberAndBicAccountIdentification try { + Logger.getLogger(NumberAndBicAccountIdentification.class.getName()).setLevel(Level.OFF); NumberAndBicAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -856,6 +865,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with PLLocalAccountIdentification try { + Logger.getLogger(PLLocalAccountIdentification.class.getName()).setLevel(Level.OFF); PLLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -864,6 +874,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SELocalAccountIdentification try { + Logger.getLogger(SELocalAccountIdentification.class.getName()).setLevel(Level.OFF); SELocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -872,6 +883,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with SGLocalAccountIdentification try { + Logger.getLogger(SGLocalAccountIdentification.class.getName()).setLevel(Level.OFF); SGLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -880,6 +892,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with UKLocalAccountIdentification try { + Logger.getLogger(UKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); UKLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { @@ -888,6 +901,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the json string with USLocalAccountIdentification try { + Logger.getLogger(USLocalAccountIdentification.class.getName()).setLevel(Level.OFF); USLocalAccountIdentification.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java index c74699123..46a76c1ce 100644 --- a/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CALocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -339,6 +341,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("transitNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CALocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -359,7 +365,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CALocalAccountIdentification` properties.", entry.getKey())); } } @@ -371,7 +377,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -382,11 +388,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java index 835c8976e..8b5fbea4a 100644 --- a/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/CZLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bankCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CZLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CZLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java index c3efe702b..081f88daf 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyInfoV3.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -186,6 +188,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CounterpartyInfoV3.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -206,12 +212,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CounterpartyInfoV3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CounterpartyInfoV3` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CounterpartyInfoV3` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field `bankAccount` if (jsonObj.getAsJsonObject("bankAccount") != null) { @@ -219,7 +225,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java index 89e0e1297..71fe37c48 100644 --- a/src/main/java/com/adyen/model/transfers/CounterpartyV3.java +++ b/src/main/java/com/adyen/model/transfers/CounterpartyV3.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -216,6 +218,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CounterpartyV3.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -236,12 +242,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!CounterpartyV3.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CounterpartyV3` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CounterpartyV3` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field `bankAccount` if (jsonObj.getAsJsonObject("bankAccount") != null) { @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java index 5c0b206cc..174c324b2 100644 --- a/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/DKLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bankCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DKLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DKLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java index 7f8b03e92..0e2e3bec4 100644 --- a/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/HULocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(HULocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `HULocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java index 5d81fc5b8..4e86f1d57 100644 --- a/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/IbanAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("iban"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IbanAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/InvalidField.java b/src/main/java/com/adyen/model/transfers/InvalidField.java index 98e74b670..75106bac2 100644 --- a/src/main/java/com/adyen/model/transfers/InvalidField.java +++ b/src/main/java/com/adyen/model/transfers/InvalidField.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -188,6 +190,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("name"); openapiRequiredFields.add("value"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(InvalidField.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -208,7 +214,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `InvalidField` properties.", entry.getKey())); } } @@ -220,15 +226,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); } // validate the optional field name if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field value if (jsonObj.get("value") != null && !jsonObj.get("value").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `value` to be a primitive type in the JSON string but got `%s`", jsonObj.get("value").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/JSONObject.java b/src/main/java/com/adyen/model/transfers/JSONObject.java index b649f74d2..12e433c1f 100644 --- a/src/main/java/com/adyen/model/transfers/JSONObject.java +++ b/src/main/java/com/adyen/model/transfers/JSONObject.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -167,6 +169,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONObject.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -187,7 +193,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties.", entry.getKey())); } } JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); diff --git a/src/main/java/com/adyen/model/transfers/JSONPath.java b/src/main/java/com/adyen/model/transfers/JSONPath.java index e08f4b571..5dd5c5774 100644 --- a/src/main/java/com/adyen/model/transfers/JSONPath.java +++ b/src/main/java/com/adyen/model/transfers/JSONPath.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -137,6 +139,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONPath.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -157,12 +163,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties.", entry.getKey())); } } // ensure the json data is an array if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); + log.log(Level.WARNING, String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/Link.java b/src/main/java/com/adyen/model/transfers/Link.java index df58c859b..2fcf9879e 100644 --- a/src/main/java/com/adyen/model/transfers/Link.java +++ b/src/main/java/com/adyen/model/transfers/Link.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -127,6 +129,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Link.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -147,12 +153,12 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Link.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Link` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Link` properties.", entry.getKey())); } } // validate the optional field href if (jsonObj.get("href") != null && !jsonObj.get("href").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); + log.log(Level.WARNING, String.format("Expected the field `href` to be a primitive type in the JSON string but got `%s`", jsonObj.get("href").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/Links.java b/src/main/java/com/adyen/model/transfers/Links.java index 1bcd7c2f6..6998b11a6 100644 --- a/src/main/java/com/adyen/model/transfers/Links.java +++ b/src/main/java/com/adyen/model/transfers/Links.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -157,6 +159,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Links.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -177,7 +183,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Links.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Links` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Links` properties.", entry.getKey())); } } // validate the optional field `next` diff --git a/src/main/java/com/adyen/model/transfers/MerchantData.java b/src/main/java/com/adyen/model/transfers/MerchantData.java index 4a481c3de..cdd810d0f 100644 --- a/src/main/java/com/adyen/model/transfers/MerchantData.java +++ b/src/main/java/com/adyen/model/transfers/MerchantData.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -215,6 +217,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantData.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -235,16 +241,16 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!MerchantData.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MerchantData` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantData` properties.", entry.getKey())); } } // validate the optional field mcc if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").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())); + log.log(Level.WARNING, String.format("Expected the field `merchantId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantId").toString())); } // validate the optional field `nameLocation` if (jsonObj.getAsJsonObject("nameLocation") != null) { @@ -252,7 +258,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postalCode").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java index 3042306e6..3544e9869 100644 --- a/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NOLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NOLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NOLocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/NameLocation.java b/src/main/java/com/adyen/model/transfers/NameLocation.java index a8038fe12..516f29da2 100644 --- a/src/main/java/com/adyen/model/transfers/NameLocation.java +++ b/src/main/java/com/adyen/model/transfers/NameLocation.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -272,6 +274,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NameLocation.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -292,32 +298,32 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!NameLocation.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NameLocation` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NameLocation` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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 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())); + log.log(Level.WARNING, 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 countryOfOrigin if (jsonObj.get("countryOfOrigin") != null && !jsonObj.get("countryOfOrigin").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `countryOfOrigin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryOfOrigin").toString())); + log.log(Level.WARNING, String.format("Expected the field `countryOfOrigin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryOfOrigin").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())); + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); } // validate the optional field rawData if (jsonObj.get("rawData") != null && !jsonObj.get("rawData").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `rawData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawData").toString())); + log.log(Level.WARNING, String.format("Expected the field `rawData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawData").toString())); } // validate the optional field state if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + log.log(Level.WARNING, String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java index 52803d88f..e55e6170d 100644 --- a/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/NumberAndBicAccountIdentification.java @@ -41,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -263,6 +265,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("bic"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NumberAndBicAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -283,7 +289,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NumberAndBicAccountIdentification` properties.", entry.getKey())); } } @@ -295,7 +301,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -303,7 +309,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java index 2e780edee..e7234c3b3 100644 --- a/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/PLLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -203,6 +205,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PLLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -223,7 +229,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PLLocalAccountIdentification` properties.", entry.getKey())); } } @@ -235,7 +241,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/PartyIdentification2.java b/src/main/java/com/adyen/model/transfers/PartyIdentification2.java index 0d007dab9..d121b8ca0 100644 --- a/src/main/java/com/adyen/model/transfers/PartyIdentification2.java +++ b/src/main/java/com/adyen/model/transfers/PartyIdentification2.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -353,6 +355,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("fullName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PartyIdentification2.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!PartyIdentification2.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PartyIdentification2` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PartyIdentification2` properties.", entry.getKey())); } } @@ -389,19 +395,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java index 60eb0ddee..65f400c39 100644 --- a/src/main/java/com/adyen/model/transfers/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/transfers/PaymentInstrument.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -214,6 +216,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrument.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -234,24 +240,24 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrument` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `tokenType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tokenType").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/ResourceReference.java b/src/main/java/com/adyen/model/transfers/ResourceReference.java index e33d075f4..b78fa8b0d 100644 --- a/src/main/java/com/adyen/model/transfers/ResourceReference.java +++ b/src/main/java/com/adyen/model/transfers/ResourceReference.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -185,6 +187,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResourceReference.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -205,20 +211,20 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResourceReference` properties.", entry.getKey())); } } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, 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/transfers/RestServiceError.java b/src/main/java/com/adyen/model/transfers/RestServiceError.java index 4b4deb6c7..f59ec90c8 100644 --- a/src/main/java/com/adyen/model/transfers/RestServiceError.java +++ b/src/main/java/com/adyen/model/transfers/RestServiceError.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -376,6 +378,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("title"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RestServiceError.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -396,7 +402,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RestServiceError` properties.", entry.getKey())); } } @@ -408,15 +414,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `detail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("detail").toString())); } // validate the optional field errorCode if (jsonObj.get("errorCode") != null && !jsonObj.get("errorCode").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `errorCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("errorCode").toString())); } // validate the optional field instance if (jsonObj.get("instance") != null && !jsonObj.get("instance").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `instance` to be a primitive type in the JSON string but got `%s`", jsonObj.get("instance").toString())); } JsonArray jsonArrayinvalidFields = jsonObj.getAsJsonArray("invalidFields"); if (jsonArrayinvalidFields != null) { @@ -432,7 +438,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `requestId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("requestId").toString())); } // validate the optional field `response` if (jsonObj.getAsJsonObject("response") != null) { @@ -440,11 +446,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("title").toString())); } // validate the optional field type if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { - 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())); + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); } } diff --git a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java index f32899850..d0ddc230f 100644 --- a/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SELocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("clearingNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SELocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SELocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java index 992093597..1ede3b65b 100644 --- a/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/SGLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -232,6 +234,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("accountNumber"); openapiRequiredFields.add("bic"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SGLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -252,7 +258,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SGLocalAccountIdentification` properties.", entry.getKey())); } } @@ -264,11 +270,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/Transaction.java b/src/main/java/com/adyen/model/transfers/Transaction.java index be6447ef7..ea0167d7c 100644 --- a/src/main/java/com/adyen/model/transfers/Transaction.java +++ b/src/main/java/com/adyen/model/transfers/Transaction.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -829,6 +831,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("status"); openapiRequiredFields.add("valueDate"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Transaction.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -849,7 +855,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Transaction.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Transaction` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Transaction` properties.", entry.getKey())); } } @@ -861,7 +867,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); } // validate the optional field `amount` if (jsonObj.getAsJsonObject("amount") != null) { @@ -869,11 +875,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // validate the optional field balancePlatform if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); } // ensure the field category can be parsed to an enum value if (jsonObj.get("category") != null) { @@ -888,11 +894,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `instructedAmount` if (jsonObj.getAsJsonObject("instructedAmount") != null) { @@ -900,15 +906,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `paymentInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentId").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())); + log.log(Level.WARNING, 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 referenceForBeneficiary 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())); + log.log(Level.WARNING, String.format("Expected the field `referenceForBeneficiary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceForBeneficiary").toString())); } // ensure the field status can be parsed to an enum value if (jsonObj.get("status") != null) { @@ -919,7 +925,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field transferId if (jsonObj.get("transferId") != null && !jsonObj.get("transferId").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `transferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferId").toString())); + log.log(Level.WARNING, String.format("Expected the field `transferId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferId").toString())); } // 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/transfers/TransactionSearchResponse.java b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java index a65fac238..b6a73fdbe 100644 --- a/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java +++ b/src/main/java/com/adyen/model/transfers/TransactionSearchResponse.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -168,6 +170,10 @@ private String toIndentedString(Object o) { // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionSearchResponse.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -188,7 +194,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransactionSearchResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransactionSearchResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionSearchResponse` properties.", entry.getKey())); } } // validate the optional field `_links` diff --git a/src/main/java/com/adyen/model/transfers/Transfer.java b/src/main/java/com/adyen/model/transfers/Transfer.java index 7e1fd9f4b..65fc118f9 100644 --- a/src/main/java/com/adyen/model/transfers/Transfer.java +++ b/src/main/java/com/adyen/model/transfers/Transfer.java @@ -44,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -833,10 +835,10 @@ public Transfer referenceForBeneficiary(String referenceForBeneficiary) { } /** - * A reference that is sent to the recipient. This reference is also sent in all notification webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * @return referenceForBeneficiary **/ - @ApiModelProperty(value = " A reference that is sent to the recipient. This reference is also sent in all notification webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others.") + @ApiModelProperty(value = " A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others.") public String getReferenceForBeneficiary() { return referenceForBeneficiary; @@ -969,6 +971,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("counterparty"); openapiRequiredFields.add("status"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Transfer.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -989,7 +995,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!Transfer.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Transfer` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Transfer` properties.", entry.getKey())); } } @@ -1013,7 +1019,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // ensure the field category can be parsed to an enum value if (jsonObj.get("category") != null) { @@ -1028,7 +1034,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); } // ensure the field direction can be parsed to an enum value if (jsonObj.get("direction") != null) { @@ -1039,7 +1045,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field `paymentInstrument` if (jsonObj.getAsJsonObject("paymentInstrument") != null) { @@ -1047,7 +1053,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `paymentInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentId").toString())); } // ensure the field priority can be parsed to an enum value if (jsonObj.get("priority") != null) { @@ -1065,11 +1071,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 referenceForBeneficiary 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())); + log.log(Level.WARNING, String.format("Expected the field `referenceForBeneficiary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("referenceForBeneficiary").toString())); } // 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/transfers/TransferInfo.java b/src/main/java/com/adyen/model/transfers/TransferInfo.java index a3d2cf825..be88b036d 100644 --- a/src/main/java/com/adyen/model/transfers/TransferInfo.java +++ b/src/main/java/com/adyen/model/transfers/TransferInfo.java @@ -43,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -411,10 +413,10 @@ public TransferInfo referenceForBeneficiary(String referenceForBeneficiary) { } /** - * A reference that is sent to the recipient. This reference is also sent in all notification webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. * @return referenceForBeneficiary **/ - @ApiModelProperty(value = " A reference that is sent to the recipient. This reference is also sent in all notification webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others.") + @ApiModelProperty(value = " A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others.") public String getReferenceForBeneficiary() { return referenceForBeneficiary; @@ -531,6 +533,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("category"); openapiRequiredFields.add("counterparty"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferInfo.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -551,7 +557,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!TransferInfo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TransferInfo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferInfo` properties.", entry.getKey())); } } @@ -567,7 +573,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); } // ensure the field category can be parsed to an enum value if (jsonObj.get("category") != null) { @@ -582,15 +588,15 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); } // validate the optional field 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())); + log.log(Level.WARNING, String.format("Expected the field `paymentInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentId").toString())); } // ensure the field priority can be parsed to an enum value if (jsonObj.get("priority") != null) { @@ -601,11 +607,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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 referenceForBeneficiary 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java index d65fddc9f..368a58516 100644 --- a/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UKLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -233,6 +235,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("sortCode"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UKLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -253,7 +259,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UKLocalAccountIdentification` properties.", entry.getKey())); } } @@ -265,11 +271,11 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java index 913894b31..3002cf834 100644 --- a/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/transfers/USLocalAccountIdentification.java @@ -40,6 +40,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -309,6 +311,10 @@ private String toIndentedString(Object o) { openapiRequiredFields.add("routingNumber"); openapiRequiredFields.add("type"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(USLocalAccountIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -329,7 +335,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties.", entry.getKey())); } } @@ -341,7 +347,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { @@ -352,7 +358,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java index bce5fe94e..7afce8aad 100644 --- a/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java +++ b/src/main/java/com/adyen/model/transfers/UltimatePartyIdentification.java @@ -42,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import com.adyen.model.transfers.JSON; @@ -353,6 +355,10 @@ private String toIndentedString(Object o) { openapiRequiredFields = new HashSet(); openapiRequiredFields.add("fullName"); } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UltimatePartyIdentification.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -373,7 +379,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { // 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())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UltimatePartyIdentification` properties.", entry.getKey())); } } @@ -389,19 +395,19 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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())); + log.log(Level.WARNING, 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) { diff --git a/src/main/java/com/adyen/service/BalanceControlApi.java b/src/main/java/com/adyen/service/BalanceControlApi.java index e1bf14206..4251425be 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/test/java/com/adyen/LegalEntityManagementTest.java b/src/test/java/com/adyen/LegalEntityManagementTest.java index fea7493fd..6d80595a3 100644 --- a/src/test/java/com/adyen/LegalEntityManagementTest.java +++ b/src/test/java/com/adyen/LegalEntityManagementTest.java @@ -1,23 +1,17 @@ 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; -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.model.checkout.CheckoutAwaitAction; +import com.adyen.model.legalentitymanagement.*; +import com.adyen.model.recurring.BankAccount; import com.adyen.service.legalentitymanagement.*; +import org.junit.Assert; import org.junit.Test; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.verify; @@ -330,4 +324,25 @@ public void TestBase64EncodedResponseToByteArray() throws Exception { Document response = service.updateDocument("SE322KT223222D5FJ7TJN2986", request); assertEquals("Thisisanbase64encodedstring", new String(response.getAttachments().get(0).getContent())); } + + @Test + public void TestNewFieldsInResponseDoesNotThrowError() throws IOException { + try { + // turn of logger so it doesn't clutter the UT + Logger.getLogger(BankAccountInfo.class.getName()).setLevel(Level.OFF); + BankAccountInfo bankAccountInfo = BankAccountInfo.fromJson("{\n" + + " \"accountIdentification\":{\n" + + " \"type\":\"usLocal\",\n" + + " \"accountNumber\":\"1234567835\",\n" + + " \"accountType\":\"checking\",\n" + + " \"routingNumber\":\"121202211\"\n" + + " },\n" + + " \"countryCode\":\"US\",\n" + + " \"trustedSource\":false,\n" + + " \"paramNotInSpec\":false\n " + + "}"); + } catch (Exception ex){ + Assert.fail(); + } + } } diff --git a/templates/libraries/okhttp-gson/oneof_model.mustache b/templates/libraries/okhttp-gson/oneof_model.mustache index e42f71658..18de42f18 100644 --- a/templates/libraries/okhttp-gson/oneof_model.mustache +++ b/templates/libraries/okhttp-gson/oneof_model.mustache @@ -216,6 +216,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#oneOf}} // validate the json string with {{{.}}} try { + Logger.getLogger({{{.}}}.class.getName()).setLevel(Level.OFF); {{{.}}}.validateJsonObject(jsonObj); validCount++; } catch (Exception e) { diff --git a/templates/libraries/okhttp-gson/pojo.mustache b/templates/libraries/okhttp-gson/pojo.mustache index a940a4af6..9b2dfe858 100644 --- a/templates/libraries/okhttp-gson/pojo.mustache +++ b/templates/libraries/okhttp-gson/pojo.mustache @@ -15,6 +15,8 @@ import java.util.HashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; import {{package}}.JSON; @@ -409,6 +411,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens openapiRequiredFields.add("{{baseName}}"); {{/requiredVars}} } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger({{classname}}.class.getName()); /** * Validates the JSON Object and throws an exception if issues found @@ -431,7 +437,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens // check to see if the JSON string contains additional fields for (Entry entry : entries) { if (!{{classname}}.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties.", entry.getKey())); } } {{/isAdditionalPropertiesTrue}} @@ -480,7 +486,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^items.isModel}} // ensure the json data is an array if ({{^isRequired}}jsonObj.get("{{{baseName}}}") != null && {{/isRequired}}!jsonObj.get("{{{baseName}}}").isJsonArray()) { - throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + log.log(Level.WARNING, String.format("Expected the field `{{{baseName}}}` to be an array in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); } {{/items.isModel}} {{/isArray}} @@ -489,7 +495,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{^isEnum}} // validate the {{#isRequired}}required{{/isRequired}}{{^isRequired}}optional{{/isRequired}} field {{{baseName}}} if ({{^isRequired}}jsonObj.get("{{{baseName}}}") != null && {{/isRequired}}!jsonObj.get("{{{baseName}}}").isJsonPrimitive()) { - throw new IllegalArgumentException(String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); + log.log(Level.WARNING, String.format("Expected the field `{{{baseName}}}` to be a primitive type in the JSON string but got `%s`", jsonObj.get("{{{baseName}}}").toString())); } {{/isEnum}} {{/isString}} From b0c764852f85c986002b17ec6bfb18a0633ddc28 Mon Sep 17 00:00:00 2001 From: Michael Paul Date: Wed, 24 May 2023 13:28:31 +0200 Subject: [PATCH 04/15] Fix shell redirect error (#1040) --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 23417ce6d..cccb962c4 100644 --- a/Makefile +++ b/Makefile @@ -95,7 +95,8 @@ $(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 + jq -e 'del(.paths[][].tags)' target/spec/json/$(spec).json > target/spec/json/$(spec).tmp + mv target/spec/json/$(spec).tmp target/spec/json/$(spec).json rm -rf $(models)/$@ $(output) rm -rf src/main/java/com/adyen/service/$@ $(output) $(openapi-generator-cli) generate \ From fb4d34dfd693cc79080945f6c5dc285a667c8118 Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Fri, 26 May 2023 15:17:35 +0100 Subject: [PATCH 05/15] new field in requestOptions for additional headers (#1039) --- .../java/com/adyen/httpclient/AdyenHttpClient.java | 4 ++++ src/main/java/com/adyen/model/RequestOptions.java | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/main/java/com/adyen/httpclient/AdyenHttpClient.java b/src/main/java/com/adyen/httpclient/AdyenHttpClient.java index 241206aac..71d2147f2 100644 --- a/src/main/java/com/adyen/httpclient/AdyenHttpClient.java +++ b/src/main/java/com/adyen/httpclient/AdyenHttpClient.java @@ -159,6 +159,10 @@ private void setHeaders(Config config, RequestOptions requestOptions, HttpUriReq if (requestOptions.getRequestedVerificationCodeHeader() != null) { httpUriRequest.addHeader(REQUESTED_VERIFICATION_CODE_HEADER, requestOptions.getRequestedVerificationCodeHeader()); } + + if (requestOptions.getAdditionalServiceHeaders() != null) { + requestOptions.getAdditionalServiceHeaders().forEach(httpUriRequest::addHeader); + } } } diff --git a/src/main/java/com/adyen/model/RequestOptions.java b/src/main/java/com/adyen/model/RequestOptions.java index 2ed4a8e92..e6fa27617 100644 --- a/src/main/java/com/adyen/model/RequestOptions.java +++ b/src/main/java/com/adyen/model/RequestOptions.java @@ -1,9 +1,12 @@ package com.adyen.model; +import java.util.HashMap; + public class RequestOptions { private String idempotencyKey; private String requestedVerificationCodeHeader; + private HashMap additionalServiceHeaders; public String getIdempotencyKey() { return idempotencyKey; @@ -21,4 +24,12 @@ public void setRequestedVerificationCodeHeader(String requestedVerificationCodeH this.requestedVerificationCodeHeader = requestedVerificationCodeHeader; } + public HashMap getAdditionalServiceHeaders() { + return additionalServiceHeaders; + } + + public void setAdditionalServiceHeaders(HashMap additionalServiceHeaders) { + this.additionalServiceHeaders = additionalServiceHeaders; + } + } From 195b553baa3e91632126adeeab5f29b0433b0215 Mon Sep 17 00:00:00 2001 From: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:48:33 +0200 Subject: [PATCH 06/15] Update models no checkout (#1043) * [create-pull-request] automated change * restore checkout models to develop state * sync checkout models with latest version of develop branch --------- Co-authored-by: AdyenAutomationBot --- .../balancecontrol/AbstractOpenApiSchema.java | 2 +- .../adyen/model/balancecontrol/Amount.java | 2 +- .../BalanceTransferRequest.java | 2 +- .../BalanceTransferResponse.java | 2 +- .../com/adyen/model/balancecontrol/JSON.java | 2 +- .../AULocalAccountIdentification.java | 2 +- .../AbstractOpenApiSchema.java | 2 +- .../model/balanceplatform/AccountHolder.java | 41 +- .../AccountHolderCapability.java | 24 +- .../balanceplatform/AccountHolderInfo.java | 41 +- .../AccountSupportingEntityCapability.java | 2 +- .../ActiveNetworkTokensRestriction.java | 2 +- .../AdditionalBankIdentification.java | 2 +- .../adyen/model/balanceplatform/Address.java | 2 +- .../adyen/model/balanceplatform/Amount.java | 2 +- .../model/balanceplatform/Authentication.java | 2 +- .../adyen/model/balanceplatform/Balance.java | 2 +- .../model/balanceplatform/BalanceAccount.java | 43 +- .../balanceplatform/BalanceAccountBase.java | 44 +- .../balanceplatform/BalanceAccountInfo.java | 44 +- .../BalanceAccountUpdateRequest.java | 44 +- .../balanceplatform/BalancePlatform.java | 2 +- .../BalanceSweepConfigurationsResponse.java | 2 +- ...ccountIdentificationValidationRequest.java | 2 +- ...alidationRequestAccountIdentification.java | 2 +- .../BrandVariantsRestriction.java | 2 +- .../model/balanceplatform/BulkAddress.java | 2 +- .../CALocalAccountIdentification.java | 2 +- .../CZLocalAccountIdentification.java | 2 +- .../balanceplatform/CapabilitySettings.java | 460 ++++++++++++++++++ .../model/balanceplatform/CapitalBalance.java | 2 +- .../balanceplatform/CapitalGrantAccount.java | 2 +- .../com/adyen/model/balanceplatform/Card.java | 2 +- .../balanceplatform/CardConfiguration.java | 2 +- .../adyen/model/balanceplatform/CardInfo.java | 2 +- .../model/balanceplatform/ContactDetails.java | 2 +- .../balanceplatform/CountriesRestriction.java | 2 +- .../balanceplatform/CronSweepSchedule.java | 8 +- .../balanceplatform/DayOfWeekRestriction.java | 2 +- .../balanceplatform/DeliveryAddress.java | 2 +- .../balanceplatform/DeliveryContact.java | 2 +- .../DifferentCurrenciesRestriction.java | 2 +- .../adyen/model/balanceplatform/Duration.java | 2 +- .../EntryModesRestriction.java | 2 +- .../adyen/model/balanceplatform/Expiry.java | 2 +- .../com/adyen/model/balanceplatform/Fee.java | 2 +- .../model/balanceplatform/GrantLimit.java | 2 +- .../model/balanceplatform/GrantOffer.java | 2 +- .../model/balanceplatform/GrantOffers.java | 2 +- .../HULocalAccountIdentification.java | 2 +- .../IbanAccountIdentification.java | 2 +- .../InternationalTransactionRestriction.java | 2 +- .../model/balanceplatform/InvalidField.java | 2 +- .../com/adyen/model/balanceplatform/JSON.java | 3 +- .../model/balanceplatform/JSONObject.java | 2 +- .../adyen/model/balanceplatform/JSONPath.java | 2 +- .../MatchingTransactionsRestriction.java | 2 +- .../balanceplatform/MccsRestriction.java | 2 +- .../balanceplatform/MerchantAcquirerPair.java | 2 +- .../MerchantNamesRestriction.java | 2 +- .../balanceplatform/MerchantsRestriction.java | 2 +- .../NOLocalAccountIdentification.java | 2 +- .../com/adyen/model/balanceplatform/Name.java | 2 +- .../NumberAndBicAccountIdentification.java | 2 +- .../PLLocalAccountIdentification.java | 2 +- .../PaginatedAccountHoldersResponse.java | 2 +- .../PaginatedBalanceAccountsResponse.java | 2 +- .../PaginatedPaymentInstrumentsResponse.java | 2 +- .../balanceplatform/PaymentInstrument.java | 12 +- .../PaymentInstrumentBankAccount.java | 2 +- .../PaymentInstrumentGroup.java | 2 +- .../PaymentInstrumentGroupInfo.java | 2 +- .../PaymentInstrumentInfo.java | 12 +- .../PaymentInstrumentRevealInfo.java | 2 +- .../PaymentInstrumentUpdateRequest.java | 6 +- .../adyen/model/balanceplatform/Phone.java | 2 +- .../model/balanceplatform/PhoneNumber.java | 2 +- .../ProcessingTypesRestriction.java | 2 +- .../model/balanceplatform/Repayment.java | 2 +- .../model/balanceplatform/RepaymentTerm.java | 2 +- .../balanceplatform/RestServiceError.java | 2 +- .../SELocalAccountIdentification.java | 2 +- .../SGLocalAccountIdentification.java | 2 +- .../model/balanceplatform/StringMatch.java | 2 +- .../balanceplatform/SweepConfigurationV2.java | 2 +- .../SweepConfigurationV2Schedule.java | 2 +- .../balanceplatform/SweepCounterparty.java | 2 +- .../model/balanceplatform/SweepSchedule.java | 8 +- .../balanceplatform/ThresholdRepayment.java | 2 +- .../model/balanceplatform/TimeOfDay.java | 2 +- .../balanceplatform/TimeOfDayRestriction.java | 2 +- .../TotalAmountRestriction.java | 2 +- .../balanceplatform/TransactionRule.java | 2 +- .../TransactionRuleEntityKey.java | 2 +- .../balanceplatform/TransactionRuleInfo.java | 2 +- .../TransactionRuleInterval.java | 2 +- .../TransactionRuleResponse.java | 2 +- .../TransactionRuleRestrictions.java | 2 +- .../TransactionRulesResponse.java | 2 +- .../UKLocalAccountIdentification.java | 2 +- .../USLocalAccountIdentification.java | 2 +- .../UpdatePaymentInstrument.java | 12 +- .../balanceplatform/VerificationDeadline.java | 2 +- .../binlookup/AbstractOpenApiSchema.java | 2 +- .../com/adyen/model/binlookup/Amount.java | 2 +- .../com/adyen/model/binlookup/BinDetail.java | 2 +- .../com/adyen/model/binlookup/CardBin.java | 2 +- .../binlookup/CostEstimateAssumptions.java | 2 +- .../model/binlookup/CostEstimateRequest.java | 2 +- .../model/binlookup/CostEstimateResponse.java | 2 +- .../model/binlookup/DSPublicKeyDetail.java | 2 +- .../java/com/adyen/model/binlookup/JSON.java | 2 +- .../model/binlookup/MerchantDetails.java | 2 +- .../com/adyen/model/binlookup/Recurring.java | 2 +- .../adyen/model/binlookup/ServiceError.java | 2 +- .../binlookup/ThreeDS2CardRangeDetail.java | 2 +- .../binlookup/ThreeDSAvailabilityRequest.java | 2 +- .../ThreeDSAvailabilityResponse.java | 2 +- .../dataprotection/AbstractOpenApiSchema.java | 2 +- .../com/adyen/model/dataprotection/JSON.java | 2 +- .../model/dataprotection/ServiceError.java | 2 +- .../SubjectErasureByPspReferenceRequest.java | 2 +- .../SubjectErasureResponse.java | 2 +- .../AULocalAccountIdentification.java | 2 +- .../AbstractOpenApiSchema.java | 2 +- .../AcceptTermsOfServiceRequest.java | 2 +- .../AcceptTermsOfServiceResponse.java | 2 +- .../AdditionalBankIdentification.java | 2 +- .../model/legalentitymanagement/Address.java | 2 +- .../model/legalentitymanagement/Amount.java | 2 +- .../legalentitymanagement/Attachment.java | 2 +- .../BankAccountInfo.java | 2 +- .../BankAccountInfoAccountIdentification.java | 2 +- .../legalentitymanagement/BirthData.java | 2 +- .../legalentitymanagement/BusinessLine.java | 78 ++- .../BusinessLineInfo.java | 78 ++- .../BusinessLineInfoUpdate.java | 74 ++- .../legalentitymanagement/BusinessLines.java | 2 +- .../CALocalAccountIdentification.java | 2 +- .../CZLocalAccountIdentification.java | 2 +- .../CapabilityProblem.java | 2 +- .../CapabilityProblemEntity.java | 6 +- .../CapabilityProblemEntityRecursive.java | 6 +- .../CapabilitySettings.java | 2 +- .../DKLocalAccountIdentification.java | 2 +- .../model/legalentitymanagement/Document.java | 12 +- .../DocumentReference.java | 2 +- .../EntityReference.java | 2 +- .../GeneratePciDescriptionRequest.java | 2 +- .../GeneratePciDescriptionResponse.java | 2 +- .../GetPciQuestionnaireInfosResponse.java | 2 +- .../GetPciQuestionnaireResponse.java | 2 +- ...TermsOfServiceAcceptanceInfosResponse.java | 2 +- .../GetTermsOfServiceDocumentRequest.java | 2 +- .../GetTermsOfServiceDocumentResponse.java | 2 +- .../HULocalAccountIdentification.java | 2 +- .../IbanAccountIdentification.java | 2 +- .../IdentificationData.java | 12 +- .../legalentitymanagement/Individual.java | 2 +- .../model/legalentitymanagement/JSON.java | 2 +- .../legalentitymanagement/LegalEntity.java | 2 +- .../LegalEntityAssociation.java | 2 +- .../LegalEntityCapability.java | 2 +- .../LegalEntityInfo.java | 2 +- .../LegalEntityInfoRequiredType.java | 2 +- .../NOLocalAccountIdentification.java | 2 +- .../model/legalentitymanagement/Name.java | 2 +- .../NumberAndBicAccountIdentification.java | 2 +- .../legalentitymanagement/OnboardingLink.java | 2 +- .../OnboardingLinkInfo.java | 2 +- .../OnboardingTheme.java | 2 +- .../OnboardingThemes.java | 2 +- .../legalentitymanagement/Organization.java | 2 +- .../legalentitymanagement/OwnerEntity.java | 2 +- .../PLLocalAccountIdentification.java | 2 +- .../PciDocumentInfo.java | 2 +- .../PciSigningRequest.java | 2 +- .../PciSigningResponse.java | 2 +- .../legalentitymanagement/PhoneNumber.java | 2 +- .../RemediatingAction.java | 2 +- .../SELocalAccountIdentification.java | 2 +- .../legalentitymanagement/ServiceError.java | 2 +- .../SoleProprietorship.java | 2 +- .../legalentitymanagement/SourceOfFunds.java | 2 +- .../legalentitymanagement/StockData.java | 2 +- .../SupportingEntityCapability.java | 2 +- .../legalentitymanagement/TaxInformation.java | 2 +- .../TaxReportingClassification.java | 2 +- .../TermsOfServiceAcceptanceInfo.java | 2 +- .../TransferInstrument.java | 2 +- .../TransferInstrumentInfo.java | 2 +- .../TransferInstrumentReference.java | 2 +- .../UKLocalAccountIdentification.java | 2 +- .../USLocalAccountIdentification.java | 2 +- .../VerificationError.java | 2 +- .../VerificationErrorRecursive.java | 2 +- .../VerificationErrors.java | 2 +- .../model/legalentitymanagement/WebData.java | 2 +- .../WebDataExemption.java | 2 +- .../model/payment/AbstractOpenApiSchema.java | 2 +- .../com/adyen/model/payment/AccountInfo.java | 2 +- .../com/adyen/model/payment/AcctInfo.java | 2 +- .../model/payment/AdditionalData3DSecure.java | 2 +- .../model/payment/AdditionalDataAirline.java | 2 +- .../payment/AdditionalDataCarRental.java | 2 +- .../model/payment/AdditionalDataCommon.java | 2 +- .../model/payment/AdditionalDataLevel23.java | 2 +- .../model/payment/AdditionalDataLodging.java | 2 +- .../payment/AdditionalDataModifications.java | 2 +- .../payment/AdditionalDataOpenInvoice.java | 2 +- .../model/payment/AdditionalDataOpi.java | 2 +- .../model/payment/AdditionalDataRatepay.java | 2 +- .../model/payment/AdditionalDataRetry.java | 2 +- .../model/payment/AdditionalDataRisk.java | 2 +- .../payment/AdditionalDataRiskStandalone.java | 2 +- .../payment/AdditionalDataSubMerchant.java | 2 +- .../AdditionalDataTemporaryServices.java | 2 +- .../model/payment/AdditionalDataWallets.java | 2 +- .../java/com/adyen/model/payment/Address.java | 2 +- .../payment/AdjustAuthorisationRequest.java | 2 +- .../java/com/adyen/model/payment/Amount.java | 2 +- .../adyen/model/payment/ApplicationInfo.java | 2 +- .../payment/AuthenticationResultRequest.java | 2 +- .../payment/AuthenticationResultResponse.java | 2 +- .../com/adyen/model/payment/BankAccount.java | 2 +- .../com/adyen/model/payment/BrowserInfo.java | 2 +- .../model/payment/CancelOrRefundRequest.java | 2 +- .../adyen/model/payment/CancelRequest.java | 2 +- .../adyen/model/payment/CaptureRequest.java | 2 +- .../java/com/adyen/model/payment/Card.java | 2 +- .../com/adyen/model/payment/CommonField.java | 2 +- .../model/payment/DeviceRenderOptions.java | 2 +- .../adyen/model/payment/DonationRequest.java | 2 +- .../adyen/model/payment/ExternalPlatform.java | 2 +- .../com/adyen/model/payment/ForexQuote.java | 2 +- .../adyen/model/payment/FraudCheckResult.java | 2 +- .../payment/FraudCheckResultWrapper.java | 2 +- .../com/adyen/model/payment/FraudResult.java | 2 +- .../adyen/model/payment/FundDestination.java | 2 +- .../com/adyen/model/payment/FundSource.java | 2 +- .../com/adyen/model/payment/Installments.java | 2 +- .../java/com/adyen/model/payment/JSON.java | 2 +- .../java/com/adyen/model/payment/Mandate.java | 2 +- .../adyen/model/payment/MerchantDevice.java | 2 +- .../model/payment/MerchantRiskIndicator.java | 2 +- .../model/payment/ModificationResult.java | 2 +- .../java/com/adyen/model/payment/Name.java | 2 +- .../adyen/model/payment/PaymentRequest.java | 2 +- .../adyen/model/payment/PaymentRequest3d.java | 2 +- .../model/payment/PaymentRequest3ds2.java | 2 +- .../adyen/model/payment/PaymentResult.java | 2 +- .../java/com/adyen/model/payment/Phone.java | 2 +- .../payment/PlatformChargebackLogic.java | 16 +- .../com/adyen/model/payment/Recurring.java | 2 +- .../adyen/model/payment/RefundRequest.java | 2 +- .../ResponseAdditionalData3DSecure.java | 2 +- .../ResponseAdditionalDataBillingAddress.java | 2 +- .../payment/ResponseAdditionalDataCard.java | 2 +- .../payment/ResponseAdditionalDataCommon.java | 2 +- .../ResponseAdditionalDataInstallments.java | 2 +- .../ResponseAdditionalDataNetworkTokens.java | 2 +- .../payment/ResponseAdditionalDataOpi.java | 2 +- .../payment/ResponseAdditionalDataSepa.java | 2 +- .../adyen/model/payment/SDKEphemPubKey.java | 2 +- .../com/adyen/model/payment/ServiceError.java | 2 +- .../payment/ShopperInteractionDevice.java | 2 +- .../java/com/adyen/model/payment/Split.java | 2 +- .../com/adyen/model/payment/SplitAmount.java | 2 +- .../com/adyen/model/payment/SubMerchant.java | 2 +- .../model/payment/TechnicalCancelRequest.java | 2 +- .../adyen/model/payment/ThreeDS1Result.java | 2 +- .../model/payment/ThreeDS2RequestData.java | 2 +- .../adyen/model/payment/ThreeDS2Result.java | 2 +- .../model/payment/ThreeDS2ResultRequest.java | 2 +- .../model/payment/ThreeDS2ResultResponse.java | 2 +- .../ThreeDSRequestorAuthenticationInfo.java | 2 +- ...reeDSRequestorPriorAuthenticationInfo.java | 2 +- .../adyen/model/payment/ThreeDSecureData.java | 2 +- .../payment/VoidPendingRefundRequest.java | 2 +- .../model/payout/AbstractOpenApiSchema.java | 2 +- .../java/com/adyen/model/payout/Address.java | 2 +- .../java/com/adyen/model/payout/Amount.java | 2 +- .../com/adyen/model/payout/BankAccount.java | 2 +- .../java/com/adyen/model/payout/Card.java | 2 +- .../adyen/model/payout/FraudCheckResult.java | 2 +- .../model/payout/FraudCheckResultWrapper.java | 2 +- .../com/adyen/model/payout/FraudResult.java | 2 +- .../com/adyen/model/payout/FundSource.java | 2 +- .../java/com/adyen/model/payout/JSON.java | 2 +- .../com/adyen/model/payout/ModifyRequest.java | 2 +- .../adyen/model/payout/ModifyResponse.java | 2 +- .../java/com/adyen/model/payout/Name.java | 2 +- .../com/adyen/model/payout/PayoutRequest.java | 2 +- .../adyen/model/payout/PayoutResponse.java | 2 +- .../com/adyen/model/payout/Recurring.java | 2 +- .../ResponseAdditionalData3DSecure.java | 2 +- .../ResponseAdditionalDataBillingAddress.java | 2 +- .../payout/ResponseAdditionalDataCard.java | 2 +- .../payout/ResponseAdditionalDataCommon.java | 2 +- .../ResponseAdditionalDataInstallments.java | 2 +- .../ResponseAdditionalDataNetworkTokens.java | 2 +- .../payout/ResponseAdditionalDataOpi.java | 2 +- .../payout/ResponseAdditionalDataSepa.java | 2 +- .../com/adyen/model/payout/ServiceError.java | 2 +- .../payout/StoreDetailAndSubmitRequest.java | 2 +- .../payout/StoreDetailAndSubmitResponse.java | 2 +- .../model/payout/StoreDetailRequest.java | 2 +- .../model/payout/StoreDetailResponse.java | 2 +- .../com/adyen/model/payout/SubmitRequest.java | 2 +- .../adyen/model/payout/SubmitResponse.java | 2 +- .../AbstractOpenApiSchema.java | 2 +- .../model/posterminalmanagement/Address.java | 2 +- .../AssignTerminalsRequest.java | 2 +- .../AssignTerminalsResponse.java | 2 +- .../FindTerminalRequest.java | 2 +- .../FindTerminalResponse.java | 2 +- .../GetStoresUnderAccountRequest.java | 2 +- .../GetStoresUnderAccountResponse.java | 2 +- .../GetTerminalDetailsRequest.java | 2 +- .../GetTerminalDetailsResponse.java | 2 +- .../GetTerminalsUnderAccountRequest.java | 2 +- .../GetTerminalsUnderAccountResponse.java | 2 +- .../model/posterminalmanagement/JSON.java | 2 +- .../MerchantAccount.java | 2 +- .../posterminalmanagement/ServiceError.java | 2 +- .../model/posterminalmanagement/Store.java | 2 +- .../recurring/AbstractOpenApiSchema.java | 2 +- .../com/adyen/model/recurring/Address.java | 2 +- .../com/adyen/model/recurring/Amount.java | 2 +- .../adyen/model/recurring/BankAccount.java | 2 +- .../java/com/adyen/model/recurring/Card.java | 2 +- .../model/recurring/CreatePermitRequest.java | 2 +- .../model/recurring/CreatePermitResult.java | 2 +- .../model/recurring/DisablePermitRequest.java | 2 +- .../model/recurring/DisablePermitResult.java | 2 +- .../adyen/model/recurring/DisableRequest.java | 2 +- .../adyen/model/recurring/DisableResult.java | 2 +- .../java/com/adyen/model/recurring/JSON.java | 2 +- .../java/com/adyen/model/recurring/Name.java | 2 +- .../model/recurring/NotifyShopperRequest.java | 2 +- .../model/recurring/NotifyShopperResult.java | 2 +- .../com/adyen/model/recurring/Permit.java | 2 +- .../model/recurring/PermitRestriction.java | 2 +- .../adyen/model/recurring/PermitResult.java | 2 +- .../com/adyen/model/recurring/Recurring.java | 2 +- .../model/recurring/RecurringDetail.java | 2 +- .../recurring/RecurringDetailWrapper.java | 2 +- .../recurring/RecurringDetailsRequest.java | 2 +- .../recurring/RecurringDetailsResult.java | 2 +- .../ScheduleAccountUpdaterRequest.java | 2 +- .../ScheduleAccountUpdaterResult.java | 2 +- .../adyen/model/recurring/ServiceError.java | 2 +- .../adyen/model/recurring/TokenDetails.java | 2 +- .../storedvalue/AbstractOpenApiSchema.java | 2 +- .../com/adyen/model/storedvalue/Amount.java | 2 +- .../com/adyen/model/storedvalue/JSON.java | 2 +- .../adyen/model/storedvalue/ServiceError.java | 2 +- .../StoredValueBalanceCheckRequest.java | 2 +- .../StoredValueBalanceCheckResponse.java | 2 +- .../StoredValueBalanceMergeRequest.java | 2 +- .../StoredValueBalanceMergeResponse.java | 2 +- .../storedvalue/StoredValueIssueRequest.java | 2 +- .../storedvalue/StoredValueIssueResponse.java | 2 +- .../storedvalue/StoredValueLoadRequest.java | 2 +- .../storedvalue/StoredValueLoadResponse.java | 2 +- .../StoredValueStatusChangeRequest.java | 2 +- .../StoredValueStatusChangeResponse.java | 2 +- .../storedvalue/StoredValueVoidRequest.java | 2 +- .../storedvalue/StoredValueVoidResponse.java | 2 +- 369 files changed, 1321 insertions(+), 455 deletions(-) create mode 100644 src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java diff --git a/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java index 5e3d95ddd..40dfc0d76 100644 --- a/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/balancecontrol/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balancecontrol/Amount.java b/src/main/java/com/adyen/model/balancecontrol/Amount.java index ca5bf3aa6..3967875af 100644 --- a/src/main/java/com/adyen/model/balancecontrol/Amount.java +++ b/src/main/java/com/adyen/model/balancecontrol/Amount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java index d7eb6318a..b9f1ab9c6 100644 --- a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java index 4e51901fe..998c91f98 100644 --- a/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java +++ b/src/main/java/com/adyen/model/balancecontrol/BalanceTransferResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balancecontrol/JSON.java b/src/main/java/com/adyen/model/balancecontrol/JSON.java index 458e4c3a0..cd97bcfde 100644 --- a/src/main/java/com/adyen/model/balancecontrol/JSON.java +++ b/src/main/java/com/adyen/model/balancecontrol/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java index d1b1e7797..d82f67cd1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AULocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java index ac17c0704..41d2db61c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/balanceplatform/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java index 451ca001a..175564ce1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolder.java @@ -2,7 +2,7 @@ * 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 @@ -81,6 +81,10 @@ public class AccountHolder { @SerializedName(SERIALIZED_NAME_LEGAL_ENTITY_ID) private String legalEntityId; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + public static final String SERIALIZED_NAME_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; @SerializedName(SERIALIZED_NAME_PRIMARY_BALANCE_ACCOUNT) private String primaryBalanceAccount; @@ -296,6 +300,36 @@ public void setLegalEntityId(String legalEntityId) { } + public AccountHolder metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public AccountHolder putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public AccountHolder primaryBalanceAccount(String primaryBalanceAccount) { this.primaryBalanceAccount = primaryBalanceAccount; @@ -413,6 +447,7 @@ public boolean equals(Object o) { Objects.equals(this.description, accountHolder.description) && Objects.equals(this.id, accountHolder.id) && Objects.equals(this.legalEntityId, accountHolder.legalEntityId) && + Objects.equals(this.metadata, accountHolder.metadata) && Objects.equals(this.primaryBalanceAccount, accountHolder.primaryBalanceAccount) && Objects.equals(this.reference, accountHolder.reference) && Objects.equals(this.status, accountHolder.status) && @@ -422,7 +457,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, primaryBalanceAccount, reference, status, timeZone, verificationDeadlines); + return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, metadata, primaryBalanceAccount, reference, status, timeZone, verificationDeadlines); } @Override @@ -435,6 +470,7 @@ public String toString() { sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" primaryBalanceAccount: ").append(toIndentedString(primaryBalanceAccount)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); @@ -468,6 +504,7 @@ private String toIndentedString(Object o) { openapiFields.add("description"); openapiFields.add("id"); openapiFields.add("legalEntityId"); + openapiFields.add("metadata"); openapiFields.add("primaryBalanceAccount"); openapiFields.add("reference"); openapiFields.add("status"); diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java index 04182dd5c..cc6a2823c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderCapability.java @@ -2,7 +2,7 @@ * 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 @@ -15,7 +15,7 @@ import java.util.Objects; import java.util.Arrays; import com.adyen.model.balanceplatform.AccountSupportingEntityCapability; -import com.adyen.model.balanceplatform.JSONObject; +import com.adyen.model.balanceplatform.CapabilitySettings; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; @@ -115,7 +115,7 @@ public AllowedLevelEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_ALLOWED_SETTINGS = "allowedSettings"; @SerializedName(SERIALIZED_NAME_ALLOWED_SETTINGS) - private JSONObject allowedSettings; + private CapabilitySettings allowedSettings; public static final String SERIALIZED_NAME_ENABLED = "enabled"; @SerializedName(SERIALIZED_NAME_ENABLED) @@ -186,7 +186,7 @@ public RequestedLevelEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_REQUESTED_SETTINGS = "requestedSettings"; @SerializedName(SERIALIZED_NAME_REQUESTED_SETTINGS) - private JSONObject requestedSettings; + private CapabilitySettings requestedSettings; public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENTS = "transferInstruments"; @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENTS) @@ -290,7 +290,7 @@ public AllowedLevelEnum getAllowedLevel() { - public AccountHolderCapability allowedSettings(JSONObject allowedSettings) { + public AccountHolderCapability allowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; return this; @@ -302,12 +302,12 @@ public AccountHolderCapability allowedSettings(JSONObject allowedSettings) { **/ @ApiModelProperty(value = "") - public JSONObject getAllowedSettings() { + public CapabilitySettings getAllowedSettings() { return allowedSettings; } - public void setAllowedSettings(JSONObject allowedSettings) { + public void setAllowedSettings(CapabilitySettings allowedSettings) { this.allowedSettings = allowedSettings; } @@ -391,7 +391,7 @@ public void setRequestedLevel(RequestedLevelEnum requestedLevel) { } - public AccountHolderCapability requestedSettings(JSONObject requestedSettings) { + public AccountHolderCapability requestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; return this; @@ -403,12 +403,12 @@ public AccountHolderCapability requestedSettings(JSONObject requestedSettings) { **/ @ApiModelProperty(value = "") - public JSONObject getRequestedSettings() { + public CapabilitySettings getRequestedSettings() { return requestedSettings; } - public void setRequestedSettings(JSONObject requestedSettings) { + public void setRequestedSettings(CapabilitySettings requestedSettings) { this.requestedSettings = requestedSettings; } @@ -569,7 +569,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `allowedSettings` if (jsonObj.getAsJsonObject("allowedSettings") != null) { - JSONObject.validateJsonObject(jsonObj.getAsJsonObject("allowedSettings")); + CapabilitySettings.validateJsonObject(jsonObj.getAsJsonObject("allowedSettings")); } // ensure the json data is an array if (jsonObj.get("problems") != null && !jsonObj.get("problems").isJsonArray()) { @@ -584,7 +584,7 @@ public static void validateJsonObject(JsonObject jsonObj) throws IOException { } // validate the optional field `requestedSettings` if (jsonObj.getAsJsonObject("requestedSettings") != null) { - JSONObject.validateJsonObject(jsonObj.getAsJsonObject("requestedSettings")); + CapabilitySettings.validateJsonObject(jsonObj.getAsJsonObject("requestedSettings")); } JsonArray jsonArraytransferInstruments = jsonObj.getAsJsonArray("transferInstruments"); if (jsonArraytransferInstruments != null) { diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java index 4e2f37581..b7ab152aa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountHolderInfo.java @@ -2,7 +2,7 @@ * 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 @@ -75,6 +75,10 @@ public class AccountHolderInfo { @SerializedName(SERIALIZED_NAME_LEGAL_ENTITY_ID) private String legalEntityId; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; @@ -204,6 +208,36 @@ public void setLegalEntityId(String legalEntityId) { } + public AccountHolderInfo metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public AccountHolderInfo putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public AccountHolderInfo reference(String reference) { this.reference = reference; @@ -263,13 +297,14 @@ public boolean equals(Object o) { Objects.equals(this.contactDetails, accountHolderInfo.contactDetails) && Objects.equals(this.description, accountHolderInfo.description) && Objects.equals(this.legalEntityId, accountHolderInfo.legalEntityId) && + Objects.equals(this.metadata, accountHolderInfo.metadata) && Objects.equals(this.reference, accountHolderInfo.reference) && Objects.equals(this.timeZone, accountHolderInfo.timeZone); } @Override public int hashCode() { - return Objects.hash(balancePlatform, capabilities, contactDetails, description, legalEntityId, reference, timeZone); + return Objects.hash(balancePlatform, capabilities, contactDetails, description, legalEntityId, metadata, reference, timeZone); } @Override @@ -281,6 +316,7 @@ public String toString() { sb.append(" contactDetails: ").append(toIndentedString(contactDetails)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); sb.append("}"); @@ -310,6 +346,7 @@ private String toIndentedString(Object o) { openapiFields.add("contactDetails"); openapiFields.add("description"); openapiFields.add("legalEntityId"); + openapiFields.add("metadata"); openapiFields.add("reference"); openapiFields.add("timeZone"); diff --git a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java index bb8505583..fd953fa32 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/balanceplatform/AccountSupportingEntityCapability.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java index 80a70c320..bb6dd1c5e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ActiveNetworkTokensRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java index a74ffd204..716724c27 100644 --- a/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/AdditionalBankIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Address.java b/src/main/java/com/adyen/model/balanceplatform/Address.java index d7359f6ed..1c4dbe073 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Address.java +++ b/src/main/java/com/adyen/model/balanceplatform/Address.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Amount.java b/src/main/java/com/adyen/model/balanceplatform/Amount.java index c028e469a..d183b32db 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Amount.java +++ b/src/main/java/com/adyen/model/balanceplatform/Amount.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Authentication.java b/src/main/java/com/adyen/model/balanceplatform/Authentication.java index 708bc40ed..9ce09abd2 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Authentication.java +++ b/src/main/java/com/adyen/model/balanceplatform/Authentication.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Balance.java b/src/main/java/com/adyen/model/balanceplatform/Balance.java index 979fca7a1..78182f65b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Balance.java +++ b/src/main/java/com/adyen/model/balanceplatform/Balance.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java index fa9b5bc76..24b112564 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccount.java @@ -2,7 +2,7 @@ * 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 @@ -24,7 +24,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; @@ -73,6 +75,10 @@ public class BalanceAccount { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; @@ -257,6 +263,36 @@ public void setId(String id) { } + public BalanceAccount metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public BalanceAccount putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public BalanceAccount reference(String reference) { this.reference = reference; @@ -338,6 +374,7 @@ public boolean equals(Object o) { Objects.equals(this.defaultCurrencyCode, balanceAccount.defaultCurrencyCode) && Objects.equals(this.description, balanceAccount.description) && Objects.equals(this.id, balanceAccount.id) && + Objects.equals(this.metadata, balanceAccount.metadata) && Objects.equals(this.reference, balanceAccount.reference) && Objects.equals(this.status, balanceAccount.status) && Objects.equals(this.timeZone, balanceAccount.timeZone); @@ -345,7 +382,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountHolderId, balances, defaultCurrencyCode, description, id, reference, status, timeZone); + return Objects.hash(accountHolderId, balances, defaultCurrencyCode, description, id, metadata, reference, status, timeZone); } @Override @@ -357,6 +394,7 @@ public String toString() { 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(" metadata: ").append(toIndentedString(metadata)).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"); @@ -387,6 +425,7 @@ private String toIndentedString(Object o) { openapiFields.add("defaultCurrencyCode"); openapiFields.add("description"); openapiFields.add("id"); + openapiFields.add("metadata"); openapiFields.add("reference"); openapiFields.add("status"); openapiFields.add("timeZone"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java index 31cf0dbaa..db8f26e4c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountBase.java @@ -2,7 +2,7 @@ * 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 @@ -22,6 +22,9 @@ 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; @@ -66,6 +69,10 @@ public class BalanceAccountBase { @SerializedName(SERIALIZED_NAME_ID) private String id; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; @@ -220,6 +227,36 @@ public void setId(String id) { } + public BalanceAccountBase metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public BalanceAccountBase putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public BalanceAccountBase reference(String reference) { this.reference = reference; @@ -300,6 +337,7 @@ public boolean equals(Object o) { Objects.equals(this.defaultCurrencyCode, balanceAccountBase.defaultCurrencyCode) && Objects.equals(this.description, balanceAccountBase.description) && Objects.equals(this.id, balanceAccountBase.id) && + Objects.equals(this.metadata, balanceAccountBase.metadata) && Objects.equals(this.reference, balanceAccountBase.reference) && Objects.equals(this.status, balanceAccountBase.status) && Objects.equals(this.timeZone, balanceAccountBase.timeZone); @@ -307,7 +345,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountHolderId, defaultCurrencyCode, description, id, reference, status, timeZone); + return Objects.hash(accountHolderId, defaultCurrencyCode, description, id, metadata, reference, status, timeZone); } @Override @@ -318,6 +356,7 @@ public String toString() { 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(" metadata: ").append(toIndentedString(metadata)).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"); @@ -347,6 +386,7 @@ private String toIndentedString(Object o) { openapiFields.add("defaultCurrencyCode"); openapiFields.add("description"); openapiFields.add("id"); + openapiFields.add("metadata"); openapiFields.add("reference"); openapiFields.add("status"); openapiFields.add("timeZone"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java index 09bb60b64..12b3f9f5d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountInfo.java @@ -2,7 +2,7 @@ * 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 @@ -22,6 +22,9 @@ 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; @@ -62,6 +65,10 @@ public class BalanceAccountInfo { @SerializedName(SERIALIZED_NAME_DESCRIPTION) private String description; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; @@ -139,6 +146,36 @@ public void setDescription(String description) { } + public BalanceAccountInfo metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public BalanceAccountInfo putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public BalanceAccountInfo reference(String reference) { this.reference = reference; @@ -196,13 +233,14 @@ public boolean equals(Object o) { return Objects.equals(this.accountHolderId, balanceAccountInfo.accountHolderId) && Objects.equals(this.defaultCurrencyCode, balanceAccountInfo.defaultCurrencyCode) && Objects.equals(this.description, balanceAccountInfo.description) && + Objects.equals(this.metadata, balanceAccountInfo.metadata) && Objects.equals(this.reference, balanceAccountInfo.reference) && Objects.equals(this.timeZone, balanceAccountInfo.timeZone); } @Override public int hashCode() { - return Objects.hash(accountHolderId, defaultCurrencyCode, description, reference, timeZone); + return Objects.hash(accountHolderId, defaultCurrencyCode, description, metadata, reference, timeZone); } @Override @@ -212,6 +250,7 @@ public String toString() { 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(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); sb.append("}"); @@ -239,6 +278,7 @@ private String toIndentedString(Object o) { openapiFields.add("accountHolderId"); openapiFields.add("defaultCurrencyCode"); openapiFields.add("description"); + openapiFields.add("metadata"); openapiFields.add("reference"); openapiFields.add("timeZone"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java index 4fd8a0310..e754cee66 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceAccountUpdateRequest.java @@ -2,7 +2,7 @@ * 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 @@ -22,6 +22,9 @@ 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; @@ -62,6 +65,10 @@ public class BalanceAccountUpdateRequest { @SerializedName(SERIALIZED_NAME_DESCRIPTION) private String description; + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + public static final String SERIALIZED_NAME_REFERENCE = "reference"; @SerializedName(SERIALIZED_NAME_REFERENCE) private String reference; @@ -194,6 +201,36 @@ public void setDescription(String description) { } + public BalanceAccountUpdateRequest metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public BalanceAccountUpdateRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs. + * @return metadata + **/ + @ApiModelProperty(value = "A set of key and value pairs for general use by the merchant. The keys do not have specific names and may be used for storing miscellaneous data as desired. > Note that during an update of metadata, the omission of existing key-value pairs will result in the deletion of those key-value pairs.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public BalanceAccountUpdateRequest reference(String reference) { this.reference = reference; @@ -273,6 +310,7 @@ public boolean equals(Object o) { return Objects.equals(this.accountHolderId, balanceAccountUpdateRequest.accountHolderId) && Objects.equals(this.defaultCurrencyCode, balanceAccountUpdateRequest.defaultCurrencyCode) && Objects.equals(this.description, balanceAccountUpdateRequest.description) && + Objects.equals(this.metadata, balanceAccountUpdateRequest.metadata) && Objects.equals(this.reference, balanceAccountUpdateRequest.reference) && Objects.equals(this.status, balanceAccountUpdateRequest.status) && Objects.equals(this.timeZone, balanceAccountUpdateRequest.timeZone); @@ -280,7 +318,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(accountHolderId, defaultCurrencyCode, description, reference, status, timeZone); + return Objects.hash(accountHolderId, defaultCurrencyCode, description, metadata, reference, status, timeZone); } @Override @@ -290,6 +328,7 @@ public String toString() { 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(" metadata: ").append(toIndentedString(metadata)).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"); @@ -318,6 +357,7 @@ private String toIndentedString(Object o) { openapiFields.add("accountHolderId"); openapiFields.add("defaultCurrencyCode"); openapiFields.add("description"); + openapiFields.add("metadata"); openapiFields.add("reference"); openapiFields.add("status"); openapiFields.add("timeZone"); diff --git a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java index 1129e0a22..90ae46290 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalancePlatform.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java index 76835e907..3542e9b1f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/BalanceSweepConfigurationsResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java index 07e71356f..07eaede10 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java index 716293c3b..b78c36066 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/BankAccountIdentificationValidationRequestAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java index 15fbb66fe..2c979aee4 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/BrandVariantsRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java index 753042b71..0c48bd149 100644 --- a/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/BulkAddress.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java index 8f8ce3f11..b26fd6e39 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CALocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java index 816fb73ba..058f0fdc0 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/CZLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java b/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java new file mode 100644 index 000000000..80a773cfa --- /dev/null +++ b/src/main/java/com/adyen/model/balanceplatform/CapabilitySettings.java @@ -0,0 +1,460 @@ +/* + * Configuration API + * + * The version of the OpenAPI document: 2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.adyen.model.balanceplatform; + +import java.util.Objects; +import java.util.Arrays; +import 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 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; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.balanceplatform.JSON; + +/** + * CapabilitySettings + */ + +public class CapabilitySettings { + public static final String SERIALIZED_NAME_AMOUNT_PER_INDUSTRY = "amountPerIndustry"; + @SerializedName(SERIALIZED_NAME_AMOUNT_PER_INDUSTRY) + private Map amountPerIndustry = null; + + public static final String SERIALIZED_NAME_AUTHORIZED_CARD_USERS = "authorizedCardUsers"; + @SerializedName(SERIALIZED_NAME_AUTHORIZED_CARD_USERS) + private Boolean authorizedCardUsers; + + /** + * Gets or Sets fundingSource + */ + @JsonAdapter(FundingSourceEnum.Adapter.class) + public enum FundingSourceEnum { + CREDIT("credit"), + + DEBIT("debit"), + + PREPAID("prepaid"); + + private String value; + + FundingSourceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FundingSourceEnum fromValue(String value) { + for (FundingSourceEnum b : FundingSourceEnum.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 FundingSourceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FundingSourceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FundingSourceEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FUNDING_SOURCE = "fundingSource"; + @SerializedName(SERIALIZED_NAME_FUNDING_SOURCE) + private List fundingSource = null; + + /** + * + */ + @JsonAdapter(IntervalEnum.Adapter.class) + public enum IntervalEnum { + DAILY("daily"), + + MONTHLY("monthly"), + + WEEKLY("weekly"); + + private String value; + + IntervalEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static IntervalEnum fromValue(String value) { + for (IntervalEnum b : IntervalEnum.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 IntervalEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public IntervalEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return IntervalEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + @SerializedName(SERIALIZED_NAME_INTERVAL) + private IntervalEnum interval; + + public static final String SERIALIZED_NAME_MAX_AMOUNT = "maxAmount"; + @SerializedName(SERIALIZED_NAME_MAX_AMOUNT) + private Amount maxAmount; + + public CapabilitySettings() { + } + + public CapabilitySettings amountPerIndustry(Map amountPerIndustry) { + + this.amountPerIndustry = amountPerIndustry; + return this; + } + + public CapabilitySettings putAmountPerIndustryItem(String key, Amount amountPerIndustryItem) { + if (this.amountPerIndustry == null) { + this.amountPerIndustry = new HashMap<>(); + } + this.amountPerIndustry.put(key, amountPerIndustryItem); + return this; + } + + /** + * + * @return amountPerIndustry + **/ + @ApiModelProperty(value = "") + + public Map getAmountPerIndustry() { + return amountPerIndustry; + } + + + public void setAmountPerIndustry(Map amountPerIndustry) { + this.amountPerIndustry = amountPerIndustry; + } + + + public CapabilitySettings authorizedCardUsers(Boolean authorizedCardUsers) { + + this.authorizedCardUsers = authorizedCardUsers; + return this; + } + + /** + * + * @return authorizedCardUsers + **/ + @ApiModelProperty(value = "") + + public Boolean getAuthorizedCardUsers() { + return authorizedCardUsers; + } + + + public void setAuthorizedCardUsers(Boolean authorizedCardUsers) { + this.authorizedCardUsers = authorizedCardUsers; + } + + + public CapabilitySettings fundingSource(List fundingSource) { + + this.fundingSource = fundingSource; + return this; + } + + public CapabilitySettings addFundingSourceItem(FundingSourceEnum fundingSourceItem) { + if (this.fundingSource == null) { + this.fundingSource = new ArrayList<>(); + } + this.fundingSource.add(fundingSourceItem); + return this; + } + + /** + * + * @return fundingSource + **/ + @ApiModelProperty(value = "") + + public List getFundingSource() { + return fundingSource; + } + + + public void setFundingSource(List fundingSource) { + this.fundingSource = fundingSource; + } + + + public CapabilitySettings interval(IntervalEnum interval) { + + this.interval = interval; + return this; + } + + /** + * + * @return interval + **/ + @ApiModelProperty(value = "") + + public IntervalEnum getInterval() { + return interval; + } + + + public void setInterval(IntervalEnum interval) { + this.interval = interval; + } + + + public CapabilitySettings maxAmount(Amount maxAmount) { + + this.maxAmount = maxAmount; + return this; + } + + /** + * Get maxAmount + * @return maxAmount + **/ + @ApiModelProperty(value = "") + + public Amount getMaxAmount() { + return maxAmount; + } + + + public void setMaxAmount(Amount maxAmount) { + this.maxAmount = maxAmount; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapabilitySettings capabilitySettings = (CapabilitySettings) o; + return Objects.equals(this.amountPerIndustry, capabilitySettings.amountPerIndustry) && + Objects.equals(this.authorizedCardUsers, capabilitySettings.authorizedCardUsers) && + Objects.equals(this.fundingSource, capabilitySettings.fundingSource) && + Objects.equals(this.interval, capabilitySettings.interval) && + Objects.equals(this.maxAmount, capabilitySettings.maxAmount); + } + + @Override + public int hashCode() { + return Objects.hash(amountPerIndustry, authorizedCardUsers, fundingSource, interval, maxAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapabilitySettings {\n"); + sb.append(" amountPerIndustry: ").append(toIndentedString(amountPerIndustry)).append("\n"); + sb.append(" authorizedCardUsers: ").append(toIndentedString(authorizedCardUsers)).append("\n"); + sb.append(" fundingSource: ").append(toIndentedString(fundingSource)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" maxAmount: ").append(toIndentedString(maxAmount)).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("amountPerIndustry"); + openapiFields.add("authorizedCardUsers"); + openapiFields.add("fundingSource"); + openapiFields.add("interval"); + openapiFields.add("maxAmount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CapabilitySettings.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CapabilitySettings + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CapabilitySettings.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CapabilitySettings is not found in the empty JSON string", CapabilitySettings.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CapabilitySettings.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CapabilitySettings` properties.", entry.getKey())); + } + } + // ensure the json data is an array + if (jsonObj.get("fundingSource") != null && !jsonObj.get("fundingSource").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `fundingSource` to be an array in the JSON string but got `%s`", jsonObj.get("fundingSource").toString())); + } + // ensure the field interval can be parsed to an enum value + if (jsonObj.get("interval") != null) { + if(!jsonObj.get("interval").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `interval` to be a primitive type in the JSON string but got `%s`", jsonObj.get("interval").toString())); + } + IntervalEnum.fromValue(jsonObj.get("interval").getAsString()); + } + // validate the optional field `maxAmount` + if (jsonObj.getAsJsonObject("maxAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("maxAmount")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CapabilitySettings.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CapabilitySettings' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CapabilitySettings.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CapabilitySettings value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CapabilitySettings read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CapabilitySettings given an JSON string + * + * @param jsonString JSON string + * @return An instance of CapabilitySettings + * @throws IOException if the JSON string is invalid with respect to CapabilitySettings + */ + public static CapabilitySettings fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CapabilitySettings.class); + } + + /** + * Convert an instance of CapabilitySettings 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/CapitalBalance.java b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java index b1cf641f0..b5cd9f21c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalBalance.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java index ce4d4e1f6..1fb9d0fb9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/CapitalGrantAccount.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Card.java b/src/main/java/com/adyen/model/balanceplatform/Card.java index 7845098d7..fe1800b23 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Card.java +++ b/src/main/java/com/adyen/model/balanceplatform/Card.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java index ceb6a31f2..e0d087351 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardConfiguration.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java index c653b07d7..1c231143b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CardInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/CardInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java index 8a8a67757..875a531ea 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java +++ b/src/main/java/com/adyen/model/balanceplatform/ContactDetails.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java index 3dc872281..944cdc1df 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/CountriesRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java index 8e9815ec0..2bcdd790f 100644 --- a/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/CronSweepSchedule.java @@ -2,7 +2,7 @@ * 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 @@ -55,7 +55,7 @@ public class CronSweepSchedule { private String cronExpression; /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -143,10 +143,10 @@ public CronSweepSchedule type(TypeEnum type) { } /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * @return type **/ - @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.") + @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction.") public TypeEnum getType() { return type; diff --git a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java index 04343a7f9..0c8ff7b65 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DayOfWeekRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java index cc2353508..27057a9ff 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java index 620e6455c..19e62e376 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java +++ b/src/main/java/com/adyen/model/balanceplatform/DeliveryContact.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java index 3e093b041..27bec7cfe 100644 --- a/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/DifferentCurrenciesRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Duration.java b/src/main/java/com/adyen/model/balanceplatform/Duration.java index 5969667e8..4473e9bf8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Duration.java +++ b/src/main/java/com/adyen/model/balanceplatform/Duration.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java index 5e3763216..795b2fffa 100644 --- a/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/EntryModesRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Expiry.java b/src/main/java/com/adyen/model/balanceplatform/Expiry.java index 30f5a0642..50190651e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Expiry.java +++ b/src/main/java/com/adyen/model/balanceplatform/Expiry.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Fee.java b/src/main/java/com/adyen/model/balanceplatform/Fee.java index efbe94300..0488dfde1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Fee.java +++ b/src/main/java/com/adyen/model/balanceplatform/Fee.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java index 21bd5e00e..9ac91958e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantLimit.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java index 8418ad7c6..d61ba3edc 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffer.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java index 9a9b3c28c..f98dda03b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java +++ b/src/main/java/com/adyen/model/balanceplatform/GrantOffers.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java index b1f7ba32e..48cc795ed 100644 --- a/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/HULocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java index 062d01ab1..150ee0b12 100644 --- a/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/IbanAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java index 31787cc24..0a424afd1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/InternationalTransactionRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java index bb7c4065a..79c1191e1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/InvalidField.java +++ b/src/main/java/com/adyen/model/balanceplatform/InvalidField.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/JSON.java b/src/main/java/com/adyen/model/balanceplatform/JSON.java index 4294800e7..96434cc91 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSON.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSON.java @@ -2,7 +2,7 @@ * 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 @@ -115,6 +115,7 @@ 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.CapabilitySettings.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()); diff --git a/src/main/java/com/adyen/model/balanceplatform/JSONObject.java b/src/main/java/com/adyen/model/balanceplatform/JSONObject.java index 3269370d7..ce83e29ca 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSONObject.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSONObject.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/JSONPath.java b/src/main/java/com/adyen/model/balanceplatform/JSONPath.java index 3dfb698fa..d133d76b8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/JSONPath.java +++ b/src/main/java/com/adyen/model/balanceplatform/JSONPath.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java index 013b1bd39..cba0faed5 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MatchingTransactionsRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java index 73eadf424..62d8a25ac 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MccsRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java index feb8b25a7..8fc3bf507 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantAcquirerPair.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java index 7ebfd0234..6d173adca 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantNamesRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java index 43bb9f494..5d784c282 100644 --- a/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/MerchantsRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java index 26256e443..5595af68e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NOLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Name.java b/src/main/java/com/adyen/model/balanceplatform/Name.java index 1600aa802..dc3914864 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Name.java +++ b/src/main/java/com/adyen/model/balanceplatform/Name.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java index 8655ae64c..c941b5ae8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/NumberAndBicAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java index ee382435e..b466f1481 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/PLLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java index 64b52e373..09e681700 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedAccountHoldersResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java index 5da67add6..c16a83401 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedBalanceAccountsResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java index fc3f5eac2..771000fbf 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaginatedPaymentInstrumentsResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java index 805775310..b8550c0d1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrument.java @@ -2,7 +2,7 @@ * 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 @@ -140,7 +140,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private StatusEnum status; /** - * 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. + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. */ @JsonAdapter(StatusReasonEnum.Adapter.class) public enum StatusReasonEnum { @@ -158,7 +158,9 @@ public enum StatusReasonEnum { STOLEN("stolen"), - SUSPECTEDFRAUD("suspectedFraud"); + SUSPECTEDFRAUD("suspectedFraud"), + + TRANSACTIONRULE("transactionRule"); private String value; @@ -461,10 +463,10 @@ public PaymentInstrument statusReason(StatusReasonEnum statusReason) { } /** - * 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. + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **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.") + @ApiModelProperty(value = "The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change.") public StatusReasonEnum getStatusReason() { return statusReason; diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java index 419c3fe49..2c0c32b80 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentBankAccount.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java index 314a73ff8..8d953cede 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroup.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java index c447a9a84..c5c0b87bf 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentGroupInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java index db2185884..df2239403 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentInfo.java @@ -2,7 +2,7 @@ * 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 @@ -131,7 +131,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { private StatusEnum status; /** - * 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. + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. */ @JsonAdapter(StatusReasonEnum.Adapter.class) public enum StatusReasonEnum { @@ -149,7 +149,9 @@ public enum StatusReasonEnum { STOLEN("stolen"), - SUSPECTEDFRAUD("suspectedFraud"); + SUSPECTEDFRAUD("suspectedFraud"), + + TRANSACTIONRULE("transactionRule"); private String value; @@ -408,10 +410,10 @@ public PaymentInstrumentInfo statusReason(StatusReasonEnum statusReason) { } /** - * 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. + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **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.") + @ApiModelProperty(value = "The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change.") public StatusReasonEnum getStatusReason() { return statusReason; diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java index e661bee0c..560a2e135 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentRevealInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java index 4778cf7d1..c95524493 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java +++ b/src/main/java/com/adyen/model/balanceplatform/PaymentInstrumentUpdateRequest.java @@ -2,7 +2,7 @@ * 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 @@ -137,7 +137,9 @@ public enum StatusReasonEnum { STOLEN("stolen"), - SUSPECTEDFRAUD("suspectedFraud"); + SUSPECTEDFRAUD("suspectedFraud"), + + TRANSACTIONRULE("transactionRule"); private String value; diff --git a/src/main/java/com/adyen/model/balanceplatform/Phone.java b/src/main/java/com/adyen/model/balanceplatform/Phone.java index 944184778..38752453a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Phone.java +++ b/src/main/java/com/adyen/model/balanceplatform/Phone.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java index eb001e57d..dcba47229 100644 --- a/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java +++ b/src/main/java/com/adyen/model/balanceplatform/PhoneNumber.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java index 50f7a9da1..3a10f648b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/ProcessingTypesRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/Repayment.java b/src/main/java/com/adyen/model/balanceplatform/Repayment.java index 6c93ad851..5be21c063 100644 --- a/src/main/java/com/adyen/model/balanceplatform/Repayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/Repayment.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java index bd6cfc5e0..a6edbe82d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java +++ b/src/main/java/com/adyen/model/balanceplatform/RepaymentTerm.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java index 92e29c7df..0bd2bb6f3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java +++ b/src/main/java/com/adyen/model/balanceplatform/RestServiceError.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java index bef3286c1..b10a3b2da 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SELocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java index 8cb75faf1..387d93f90 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/SGLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java index 23d7a3533..325de133e 100644 --- a/src/main/java/com/adyen/model/balanceplatform/StringMatch.java +++ b/src/main/java/com/adyen/model/balanceplatform/StringMatch.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java index 5dff25e55..3c6248132 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java index 8a5d7a7b4..dbe64558c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepConfigurationV2Schedule.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java index bceb20b04..e0f2af951 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepCounterparty.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java index 3b59dbb7a..e29bcf50d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java +++ b/src/main/java/com/adyen/model/balanceplatform/SweepSchedule.java @@ -2,7 +2,7 @@ * 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 @@ -51,7 +51,7 @@ public class SweepSchedule { /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. */ @JsonAdapter(TypeEnum.Adapter.class) public enum TypeEnum { @@ -117,10 +117,10 @@ public SweepSchedule type(TypeEnum type) { } /** - * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction. * @return type **/ - @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.") + @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.If the source is transferInstrument, merchant account identifier is still required, with which you want to process the transaction.") public TypeEnum getType() { return type; diff --git a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java index e3d73ad59..8b170c26a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java +++ b/src/main/java/com/adyen/model/balanceplatform/ThresholdRepayment.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java index 106956a79..a27ffaa37 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDay.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java index deb557e77..aa8f966e3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TimeOfDayRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java index 5c7184e96..82438d30b 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java +++ b/src/main/java/com/adyen/model/balanceplatform/TotalAmountRestriction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java index ad761ebe8..ba5b3aad8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRule.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java index 542eae109..a1a5c089a 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleEntityKey.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java index 29abf46d7..511006eb1 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java index 75b05d562..7f324ffb9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleInterval.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java index dfd248284..7c4932b9d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java index 297186e21..60c9b404d 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRuleRestrictions.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java index a9ffd336c..eb755e8c8 100644 --- a/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java +++ b/src/main/java/com/adyen/model/balanceplatform/TransactionRulesResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java index 7d0ee8278..e809e1b0c 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/UKLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java index 2cd066d2a..99c0aa2f9 100644 --- a/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/balanceplatform/USLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java index 281904c84..ebccab882 100644 --- a/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java +++ b/src/main/java/com/adyen/model/balanceplatform/UpdatePaymentInstrument.java @@ -2,7 +2,7 @@ * 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 @@ -144,7 +144,7 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { 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. + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. */ @JsonAdapter(StatusReasonEnum.Adapter.class) public enum StatusReasonEnum { @@ -162,7 +162,9 @@ public enum StatusReasonEnum { STOLEN("stolen"), - SUSPECTEDFRAUD("suspectedFraud"); + SUSPECTEDFRAUD("suspectedFraud"), + + TRANSACTIONRULE("transactionRule"); private String value; @@ -487,10 +489,10 @@ public UpdatePaymentInstrument statusReason(StatusReasonEnum statusReason) { } /** - * 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. + * The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **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.") + @ApiModelProperty(value = "The reason for the status of the payment instrument. Possible values: **accountClosure**, **damaged**, **endOfLife**, **expired**, **lost**, **stolen**, **suspectedFraud**, **transactionRule**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change.") public StatusReasonEnum getStatusReason() { return statusReason; diff --git a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java index 257195783..97fdb15b3 100644 --- a/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java +++ b/src/main/java/com/adyen/model/balanceplatform/VerificationDeadline.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java index c2bba329f..81dc25d9a 100644 --- a/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/binlookup/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/Amount.java b/src/main/java/com/adyen/model/binlookup/Amount.java index ea9a4b3fd..de934e745 100644 --- a/src/main/java/com/adyen/model/binlookup/Amount.java +++ b/src/main/java/com/adyen/model/binlookup/Amount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/BinDetail.java b/src/main/java/com/adyen/model/binlookup/BinDetail.java index 3bb632c04..0943c066b 100644 --- a/src/main/java/com/adyen/model/binlookup/BinDetail.java +++ b/src/main/java/com/adyen/model/binlookup/BinDetail.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/CardBin.java b/src/main/java/com/adyen/model/binlookup/CardBin.java index 1c3049838..e63d9cd7a 100644 --- a/src/main/java/com/adyen/model/binlookup/CardBin.java +++ b/src/main/java/com/adyen/model/binlookup/CardBin.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java index f835c2976..38c34de3e 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateAssumptions.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java index 456125c5a..d5a5638a5 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java index aba9eb3ed..83e77b248 100644 --- a/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java +++ b/src/main/java/com/adyen/model/binlookup/CostEstimateResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java index 17d7fe486..6f603f300 100644 --- a/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java +++ b/src/main/java/com/adyen/model/binlookup/DSPublicKeyDetail.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/JSON.java b/src/main/java/com/adyen/model/binlookup/JSON.java index 49e16ece0..7b54a4272 100644 --- a/src/main/java/com/adyen/model/binlookup/JSON.java +++ b/src/main/java/com/adyen/model/binlookup/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java index d71fcad52..fe8154bed 100644 --- a/src/main/java/com/adyen/model/binlookup/MerchantDetails.java +++ b/src/main/java/com/adyen/model/binlookup/MerchantDetails.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/Recurring.java b/src/main/java/com/adyen/model/binlookup/Recurring.java index 0e8b2b5ed..dfd6d5716 100644 --- a/src/main/java/com/adyen/model/binlookup/Recurring.java +++ b/src/main/java/com/adyen/model/binlookup/Recurring.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/ServiceError.java b/src/main/java/com/adyen/model/binlookup/ServiceError.java index f1ec41b7d..54e241f61 100644 --- a/src/main/java/com/adyen/model/binlookup/ServiceError.java +++ b/src/main/java/com/adyen/model/binlookup/ServiceError.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java index 2ad524c82..7609f768d 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDS2CardRangeDetail.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java index 3b82d7e89..547fff9ff 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java index cdd7bc1f8..d76824292 100644 --- a/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java +++ b/src/main/java/com/adyen/model/binlookup/ThreeDSAvailabilityResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java index 7b8ee691d..68d31ca22 100644 --- a/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/dataprotection/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/dataprotection/JSON.java b/src/main/java/com/adyen/model/dataprotection/JSON.java index 108db5b92..27c76dbc1 100644 --- a/src/main/java/com/adyen/model/dataprotection/JSON.java +++ b/src/main/java/com/adyen/model/dataprotection/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/dataprotection/ServiceError.java b/src/main/java/com/adyen/model/dataprotection/ServiceError.java index a457ad690..5df61fbcf 100644 --- a/src/main/java/com/adyen/model/dataprotection/ServiceError.java +++ b/src/main/java/com/adyen/model/dataprotection/ServiceError.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java index 6f3930086..fc4e5800f 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureByPspReferenceRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java index 3a6774f68..ebc410375 100644 --- a/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java +++ b/src/main/java/com/adyen/model/dataprotection/SubjectErasureResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java index 4981c877b..d02a3c258 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AULocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java index 40644ee1f..ff98266ad 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java index f48962f73..2f0d2e89b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java index 2e06c294d..e57a66fc2 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java index 47d269612..596f58c92 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/AdditionalBankIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Address.java b/src/main/java/com/adyen/model/legalentitymanagement/Address.java index 3f323b4ce..5b6d0c152 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Address.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Address.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java index 3972ef17d..d5e221d0e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Amount.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Amount.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java index 8122697b9..14ad2de2b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Attachment.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java index d14a85447..2c7c8ea95 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java index 1b2a47b91..627132563 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BankAccountInfoAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java index c89b3dc5b..2ca6f0c55 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BirthData.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java index 3d0843383..d87221cba 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLine.java @@ -2,7 +2,7 @@ * 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 @@ -56,10 +56,59 @@ */ public class BusinessLine { + /** + * The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** + */ + @JsonAdapter(CapabilityEnum.Adapter.class) + public enum CapabilityEnum { + RECEIVEPAYMENTS("receivePayments"), + + RECEIVEFROMPLATFORMPAYMENTS("receiveFromPlatformPayments"), + + ISSUEBANKACCOUNT("issueBankAccount"); + + private String value; + + CapabilityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CapabilityEnum fromValue(String value) { + for (CapabilityEnum b : CapabilityEnum.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 CapabilityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CapabilityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CapabilityEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_CAPABILITY = "capability"; @Deprecated @SerializedName(SERIALIZED_NAME_CAPABILITY) - private String capability; + private CapabilityEnum capability; public static final String SERIALIZED_NAME_ID = "id"; @SerializedName(SERIALIZED_NAME_ID) @@ -82,7 +131,7 @@ public class BusinessLine { private List salesChannels = null; /** - * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** */ @JsonAdapter(ServiceEnum.Adapter.class) public enum ServiceEnum { @@ -158,27 +207,27 @@ public BusinessLine( } @Deprecated - public BusinessLine capability(String capability) { + public BusinessLine capability(CapabilityEnum capability) { this.capability = capability; return this; } /** - * The capability for which you are creating the business line. For example, **receivePayments**. + * The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** * @return capability * @deprecated **/ @Deprecated - @ApiModelProperty(value = "The capability for which you are creating the business line. For example, **receivePayments**.") + @ApiModelProperty(value = "The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount**") - public String getCapability() { + public CapabilityEnum getCapability() { return capability; } @Deprecated - public void setCapability(String capability) { + public void setCapability(CapabilityEnum capability) { this.capability = capability; } @@ -307,10 +356,10 @@ public BusinessLine service(ServiceEnum service) { } /** - * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * @return service **/ - @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking**") + @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking**") public ServiceEnum getService() { return service; @@ -511,9 +560,12 @@ 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 capability - if (jsonObj.get("capability") != null && !jsonObj.get("capability").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); + // ensure the field capability can be parsed to an enum value + if (jsonObj.get("capability") != null) { + if(!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())); + } + CapabilityEnum.fromValue(jsonObj.get("capability").getAsString()); } // validate the optional field id if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java index 1ddff277b..eae7669b8 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfo.java @@ -2,7 +2,7 @@ * 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 @@ -55,10 +55,59 @@ */ public class BusinessLineInfo { + /** + * The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** + */ + @JsonAdapter(CapabilityEnum.Adapter.class) + public enum CapabilityEnum { + RECEIVEPAYMENTS("receivePayments"), + + RECEIVEFROMPLATFORMPAYMENTS("receiveFromPlatformPayments"), + + ISSUEBANKACCOUNT("issueBankAccount"); + + private String value; + + CapabilityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CapabilityEnum fromValue(String value) { + for (CapabilityEnum b : CapabilityEnum.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 CapabilityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CapabilityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CapabilityEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_CAPABILITY = "capability"; @Deprecated @SerializedName(SERIALIZED_NAME_CAPABILITY) - private String capability; + private CapabilityEnum capability; public static final String SERIALIZED_NAME_INDUSTRY_CODE = "industryCode"; @SerializedName(SERIALIZED_NAME_INDUSTRY_CODE) @@ -73,7 +122,7 @@ public class BusinessLineInfo { private List salesChannels = null; /** - * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** */ @JsonAdapter(ServiceEnum.Adapter.class) public enum ServiceEnum { @@ -141,27 +190,27 @@ public BusinessLineInfo() { } @Deprecated - public BusinessLineInfo capability(String capability) { + public BusinessLineInfo capability(CapabilityEnum capability) { this.capability = capability; return this; } /** - * The capability for which you are creating the business line. For example, **receivePayments**. + * The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount** * @return capability * @deprecated **/ @Deprecated - @ApiModelProperty(value = "The capability for which you are creating the business line. For example, **receivePayments**.") + @ApiModelProperty(value = "The capability for which you are creating the business line. Possible values: **receivePayments**, **receiveFromPlatformPayments**, **issueBankAccount**") - public String getCapability() { + public CapabilityEnum getCapability() { return capability; } @Deprecated - public void setCapability(String capability) { + public void setCapability(CapabilityEnum capability) { this.capability = capability; } @@ -247,10 +296,10 @@ public BusinessLineInfo service(ServiceEnum service) { } /** - * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * @return service **/ - @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking**") + @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking**") public ServiceEnum getService() { return service; @@ -444,9 +493,12 @@ 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 capability - if (jsonObj.get("capability") != null && !jsonObj.get("capability").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); + // ensure the field capability can be parsed to an enum value + if (jsonObj.get("capability") != null) { + if(!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())); + } + CapabilityEnum.fromValue(jsonObj.get("capability").getAsString()); } // validate the optional field industryCode if (jsonObj.get("industryCode") != null && !jsonObj.get("industryCode").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java index fdc03cfa0..c45347426 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLineInfoUpdate.java @@ -2,7 +2,7 @@ * 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 @@ -55,10 +55,59 @@ */ public class BusinessLineInfoUpdate { + /** + * The capability for which you are creating the business line. For example, **receivePayments**. + */ + @JsonAdapter(CapabilityEnum.Adapter.class) + public enum CapabilityEnum { + RECEIVEPAYMENTS("receivePayments"), + + RECEIVEFROMPLATFORMPAYMENTS("receiveFromPlatformPayments"), + + ISSUEBANKACCOUNT("issueBankAccount"); + + private String value; + + CapabilityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CapabilityEnum fromValue(String value) { + for (CapabilityEnum b : CapabilityEnum.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 CapabilityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CapabilityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CapabilityEnum.fromValue(value); + } + } + } + public static final String SERIALIZED_NAME_CAPABILITY = "capability"; @Deprecated @SerializedName(SERIALIZED_NAME_CAPABILITY) - private String capability; + private CapabilityEnum capability; public static final String SERIALIZED_NAME_INDUSTRY_CODE = "industryCode"; @SerializedName(SERIALIZED_NAME_INDUSTRY_CODE) @@ -73,7 +122,7 @@ public class BusinessLineInfoUpdate { private List salesChannels = null; /** - * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** */ @JsonAdapter(ServiceEnum.Adapter.class) public enum ServiceEnum { @@ -141,7 +190,7 @@ public BusinessLineInfoUpdate() { } @Deprecated - public BusinessLineInfoUpdate capability(String capability) { + public BusinessLineInfoUpdate capability(CapabilityEnum capability) { this.capability = capability; return this; @@ -155,13 +204,13 @@ public BusinessLineInfoUpdate capability(String capability) { @Deprecated @ApiModelProperty(value = "The capability for which you are creating the business line. For example, **receivePayments**.") - public String getCapability() { + public CapabilityEnum getCapability() { return capability; } @Deprecated - public void setCapability(String capability) { + public void setCapability(CapabilityEnum capability) { this.capability = capability; } @@ -247,10 +296,10 @@ public BusinessLineInfoUpdate service(ServiceEnum service) { } /** - * The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking** + * The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking** * @return service **/ - @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values:**paymentProcessing**, **issuing**, **banking**") + @ApiModelProperty(required = true, value = "The service for which you are creating the business line. Possible values: **paymentProcessing**, **issuing**, **banking**") public ServiceEnum getService() { return service; @@ -442,9 +491,12 @@ 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 capability - if (jsonObj.get("capability") != null && !jsonObj.get("capability").isJsonPrimitive()) { - log.log(Level.WARNING, String.format("Expected the field `capability` to be a primitive type in the JSON string but got `%s`", jsonObj.get("capability").toString())); + // ensure the field capability can be parsed to an enum value + if (jsonObj.get("capability") != null) { + if(!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())); + } + CapabilityEnum.fromValue(jsonObj.get("capability").getAsString()); } // validate the optional field industryCode if (jsonObj.get("industryCode") != null && !jsonObj.get("industryCode").isJsonPrimitive()) { diff --git a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java index 138d19ddd..a1d742c10 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/BusinessLines.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java index 83f187f4c..0a792a739 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CALocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java index ca3bb6d7d..bc6b46f3c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CZLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java index 9083abed4..3e9dd3a1c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblem.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java index 204a660ca..fd9dfeb01 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntity.java @@ -2,7 +2,7 @@ * 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 @@ -74,7 +74,9 @@ public enum TypeEnum { DOCUMENT("Document"), - LEGALENTITY("LegalEntity"); + LEGALENTITY("LegalEntity"), + + PRODUCT("product"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java index 0b9d7fefe..e5a3bd168 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilityProblemEntityRecursive.java @@ -2,7 +2,7 @@ * 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 @@ -69,7 +69,9 @@ public enum TypeEnum { DOCUMENT("Document"), - LEGALENTITY("LegalEntity"); + LEGALENTITY("LegalEntity"), + + PRODUCT("product"); private String value; diff --git a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java index 60b7c1510..9fc0f06cb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/CapabilitySettings.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java index 0a543f751..d07d63508 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DKLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Document.java b/src/main/java/com/adyen/model/legalentitymanagement/Document.java index 835faf120..9c736caae 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Document.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Document.java @@ -2,7 +2,7 @@ * 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 @@ -107,7 +107,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**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * 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 { @@ -135,7 +135,9 @@ public enum TypeEnum { PROOFOFINDUSTRY("proofOfIndustry"), - CONSTITUTIONALDOCUMENT("constitutionalDocument"); + CONSTITUTIONALDOCUMENT("constitutionalDocument"), + + PROOFOFFUNDINGORWEALTHSOURCE("proofOfFundingOrWealthSource"); private String value; @@ -455,10 +457,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**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * 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**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * 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/DocumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java index 2a2d7076e..334fc7d46 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/DocumentReference.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java index 6c8c7db06..2c0fd46a9 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/EntityReference.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java index 4ef661cfe..dd53db599 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java index 1d1582dcb..32eeba006 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GeneratePciDescriptionResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java index fc8a7e52d..ecac4398e 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireInfosResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java index be1049bd7..4f95d8053 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetPciQuestionnaireResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java index a3f42ff82..0a65ad9c5 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceAcceptanceInfosResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java index c2e4c6f46..3e17efc83 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java index 19b8ddf5f..276cd9544 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/GetTermsOfServiceDocumentResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java index 7c1785ab4..39dfb32e6 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/HULocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java index 3b5fd3c6e..310090c91 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IbanAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java index 1215a425c..7547ab641 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/IdentificationData.java @@ -2,7 +2,7 @@ * 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 @@ -77,7 +77,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**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * 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 { @@ -105,7 +105,9 @@ public enum TypeEnum { PROOFOFINDUSTRY("proofOfIndustry"), - CONSTITUTIONALDOCUMENT("constitutionalDocument"); + CONSTITUTIONALDOCUMENT("constitutionalDocument"), + + PROOFOFFUNDINGORWEALTHSOURCE("proofOfFundingOrWealthSource"); private String value; @@ -299,10 +301,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**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * 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**, **proofOfIndustry**, or **proofOfFundingOrWealthSource**. * For **individual**, the `type` values can be **identityCard**, **driversLicense**, **passport**, **proofOfNationalIdNumber**, **proofOfResidency**, **proofOfIndustry**, **proofOfIndividualTaxId**, or **proofOfFundingOrWealthSource**. * 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/Individual.java b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java index 8d4e61bfb..e9094ea39 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Individual.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Individual.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/JSON.java b/src/main/java/com/adyen/model/legalentitymanagement/JSON.java index a339a3955..52b0b52d2 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/JSON.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/JSON.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java index 4c9546984..92e5be188 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntity.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java index 56d9afbf5..9e0a6fcc1 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityAssociation.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java index 07f0b494a..fd298efec 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityCapability.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java index 500e82942..c156a838c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java index 4be320a14..8f5278846 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/LegalEntityInfoRequiredType.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java index 5d85319bf..89da3ca30 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NOLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Name.java b/src/main/java/com/adyen/model/legalentitymanagement/Name.java index fe55575ef..3504b186d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Name.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Name.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java index f438e54af..dc075edc5 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/NumberAndBicAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java index 3e98859a0..42d44a9c2 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLink.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java index baec93e18..0caaace63 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingLinkInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java index e853f4156..3be268ba4 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingTheme.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java index 9a326e332..2b4a0d0aa 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OnboardingThemes.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java index 58ca09e2d..6c128f6d2 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/Organization.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/Organization.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java index db51b8e22..74f094d5b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/OwnerEntity.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java index 3b45b75c8..cf836114a 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PLLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java index f19e9ad44..886889b49 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciDocumentInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java index a67f67d50..f498f40d4 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java index cc2b55415..3c15476cd 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PciSigningResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java index aeaad6bed..7c7f93da7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/PhoneNumber.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java index 59bc7a81b..fbfe8e819 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/RemediatingAction.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java index daedc3d31..903d4d3ce 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SELocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java index e68abcf25..302bd628d 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/ServiceError.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java index 8508e73ee..c86a38e9c 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SoleProprietorship.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java index b4654e5c9..414baab9b 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SourceOfFunds.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java index 8ef1cba68..4b02ffb26 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/StockData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/StockData.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java index 0ab97ccf1..cf42a15aa 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/SupportingEntityCapability.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java index f83804526..52341abc0 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxInformation.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java index 435742d71..f2d743e54 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TaxReportingClassification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java index b6a1e47e1..97960fb3f 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TermsOfServiceAcceptanceInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java index 36e362a38..ad95c5820 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrument.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java index 6e7c25467..d1e501a40 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentInfo.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java index c90374663..509b79c78 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/TransferInstrumentReference.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java index 3da6b90bf..6a4caf0ac 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/UKLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java index fbda30a92..9935edce7 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/USLocalAccountIdentification.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java index d7d092a4b..e899a7b87 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationError.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java index 070b3f70c..74fe54ccb 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrorRecursive.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java index 84102592e..baa9bbbf4 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/VerificationErrors.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java index f36bff96f..fdc881573 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebData.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebData.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java index 76470e341..b6504e977 100644 --- a/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java +++ b/src/main/java/com/adyen/model/legalentitymanagement/WebDataExemption.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java index 6dc0baa88..3ad1b0d2d 100644 --- a/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/payment/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AccountInfo.java b/src/main/java/com/adyen/model/payment/AccountInfo.java index 0628f5252..b1df189be 100644 --- a/src/main/java/com/adyen/model/payment/AccountInfo.java +++ b/src/main/java/com/adyen/model/payment/AccountInfo.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AcctInfo.java b/src/main/java/com/adyen/model/payment/AcctInfo.java index 7acee1c07..e986831e3 100644 --- a/src/main/java/com/adyen/model/payment/AcctInfo.java +++ b/src/main/java/com/adyen/model/payment/AcctInfo.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java index 404ee51b7..66ead04de 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/AdditionalData3DSecure.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java index 94de1e4d1..a92f95fb6 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataAirline.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java index 23523f872..60fab508a 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCarRental.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java index d61c38dcc..c1c3556c3 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataCommon.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java index 82938e624..80f000dda 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLevel23.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java index 924eb150e..3a6b7af8d 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataLodging.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java index a0079c1f0..9415f7d9f 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataModifications.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java index 9d3e69781..c8a36258d 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpenInvoice.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java index 4dcb7225b..88c71594b 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataOpi.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java index 74514b021..54ec39bbc 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRatepay.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java index 665122b24..2914ed5a5 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRetry.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java index b1c8fb1cc..3439f6c12 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRisk.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java index a79e6927e..0499a4359 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataRiskStandalone.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java index de486f74c..5f6b1e0de 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataSubMerchant.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java index addfc13ea..ac9ab925a 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataTemporaryServices.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java index 5d1816abe..247176d42 100644 --- a/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/payment/AdditionalDataWallets.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Address.java b/src/main/java/com/adyen/model/payment/Address.java index e9064fe9e..0e7015030 100644 --- a/src/main/java/com/adyen/model/payment/Address.java +++ b/src/main/java/com/adyen/model/payment/Address.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java index d020c2ff2..29a075bc4 100644 --- a/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java +++ b/src/main/java/com/adyen/model/payment/AdjustAuthorisationRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Amount.java b/src/main/java/com/adyen/model/payment/Amount.java index caafba34d..48ed039ac 100644 --- a/src/main/java/com/adyen/model/payment/Amount.java +++ b/src/main/java/com/adyen/model/payment/Amount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ApplicationInfo.java b/src/main/java/com/adyen/model/payment/ApplicationInfo.java index 09f6ac627..0bd437095 100644 --- a/src/main/java/com/adyen/model/payment/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/payment/ApplicationInfo.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java index 8e94293e9..461d525b0 100644 --- a/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java index e06e23f71..2a917c6b5 100644 --- a/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java +++ b/src/main/java/com/adyen/model/payment/AuthenticationResultResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/BankAccount.java b/src/main/java/com/adyen/model/payment/BankAccount.java index ddebb10e3..68269c05e 100644 --- a/src/main/java/com/adyen/model/payment/BankAccount.java +++ b/src/main/java/com/adyen/model/payment/BankAccount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/BrowserInfo.java b/src/main/java/com/adyen/model/payment/BrowserInfo.java index 7d6734272..8dac31374 100644 --- a/src/main/java/com/adyen/model/payment/BrowserInfo.java +++ b/src/main/java/com/adyen/model/payment/BrowserInfo.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java index ed9aa4e6b..2bf593db7 100644 --- a/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelOrRefundRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/CancelRequest.java b/src/main/java/com/adyen/model/payment/CancelRequest.java index 66f062f17..a9ce2ed50 100644 --- a/src/main/java/com/adyen/model/payment/CancelRequest.java +++ b/src/main/java/com/adyen/model/payment/CancelRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/CaptureRequest.java b/src/main/java/com/adyen/model/payment/CaptureRequest.java index 834860932..58f93b70d 100644 --- a/src/main/java/com/adyen/model/payment/CaptureRequest.java +++ b/src/main/java/com/adyen/model/payment/CaptureRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Card.java b/src/main/java/com/adyen/model/payment/Card.java index 08b210f8a..19aa49eee 100644 --- a/src/main/java/com/adyen/model/payment/Card.java +++ b/src/main/java/com/adyen/model/payment/Card.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/CommonField.java b/src/main/java/com/adyen/model/payment/CommonField.java index b656cc966..f7a9cce40 100644 --- a/src/main/java/com/adyen/model/payment/CommonField.java +++ b/src/main/java/com/adyen/model/payment/CommonField.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java index 8009b33b7..8a3d482e6 100644 --- a/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/payment/DeviceRenderOptions.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/DonationRequest.java b/src/main/java/com/adyen/model/payment/DonationRequest.java index e692ad39e..fbb526d4d 100644 --- a/src/main/java/com/adyen/model/payment/DonationRequest.java +++ b/src/main/java/com/adyen/model/payment/DonationRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ExternalPlatform.java b/src/main/java/com/adyen/model/payment/ExternalPlatform.java index 491280df5..927103b18 100644 --- a/src/main/java/com/adyen/model/payment/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/payment/ExternalPlatform.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ForexQuote.java b/src/main/java/com/adyen/model/payment/ForexQuote.java index 532edb3eb..afa386f13 100644 --- a/src/main/java/com/adyen/model/payment/ForexQuote.java +++ b/src/main/java/com/adyen/model/payment/ForexQuote.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/FraudCheckResult.java b/src/main/java/com/adyen/model/payment/FraudCheckResult.java index f52568c08..76d4fb70c 100644 --- a/src/main/java/com/adyen/model/payment/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java index 73d669e4f..b9be52cf5 100644 --- a/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payment/FraudCheckResultWrapper.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/FraudResult.java b/src/main/java/com/adyen/model/payment/FraudResult.java index 8ff56dd74..0a71b5b88 100644 --- a/src/main/java/com/adyen/model/payment/FraudResult.java +++ b/src/main/java/com/adyen/model/payment/FraudResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/FundDestination.java b/src/main/java/com/adyen/model/payment/FundDestination.java index 0f719dc1e..325c1923b 100644 --- a/src/main/java/com/adyen/model/payment/FundDestination.java +++ b/src/main/java/com/adyen/model/payment/FundDestination.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/FundSource.java b/src/main/java/com/adyen/model/payment/FundSource.java index 9077c8ad0..6bb924c26 100644 --- a/src/main/java/com/adyen/model/payment/FundSource.java +++ b/src/main/java/com/adyen/model/payment/FundSource.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Installments.java b/src/main/java/com/adyen/model/payment/Installments.java index edf9f8802..d7af0372c 100644 --- a/src/main/java/com/adyen/model/payment/Installments.java +++ b/src/main/java/com/adyen/model/payment/Installments.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/JSON.java b/src/main/java/com/adyen/model/payment/JSON.java index 761562ecc..20e38714b 100644 --- a/src/main/java/com/adyen/model/payment/JSON.java +++ b/src/main/java/com/adyen/model/payment/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Mandate.java b/src/main/java/com/adyen/model/payment/Mandate.java index e54894db7..e53b6b871 100644 --- a/src/main/java/com/adyen/model/payment/Mandate.java +++ b/src/main/java/com/adyen/model/payment/Mandate.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/MerchantDevice.java b/src/main/java/com/adyen/model/payment/MerchantDevice.java index 679aaa5c7..f3f925c40 100644 --- a/src/main/java/com/adyen/model/payment/MerchantDevice.java +++ b/src/main/java/com/adyen/model/payment/MerchantDevice.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java index 90fe40bd6..592dd4c23 100644 --- a/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/payment/MerchantRiskIndicator.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ModificationResult.java b/src/main/java/com/adyen/model/payment/ModificationResult.java index a0c5ab32c..cd7ccaedd 100644 --- a/src/main/java/com/adyen/model/payment/ModificationResult.java +++ b/src/main/java/com/adyen/model/payment/ModificationResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Name.java b/src/main/java/com/adyen/model/payment/Name.java index fa541c2b5..f2400f0af 100644 --- a/src/main/java/com/adyen/model/payment/Name.java +++ b/src/main/java/com/adyen/model/payment/Name.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest.java b/src/main/java/com/adyen/model/payment/PaymentRequest.java index 3fb17f033..415ae7c0b 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest3d.java b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java index 6f1646d69..dbca55ed8 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest3d.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3d.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java index 37a6c921c..df8b162f1 100644 --- a/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java +++ b/src/main/java/com/adyen/model/payment/PaymentRequest3ds2.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/PaymentResult.java b/src/main/java/com/adyen/model/payment/PaymentResult.java index df11c0616..1aa6815a1 100644 --- a/src/main/java/com/adyen/model/payment/PaymentResult.java +++ b/src/main/java/com/adyen/model/payment/PaymentResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Phone.java b/src/main/java/com/adyen/model/payment/Phone.java index f5a4acf01..522810430 100644 --- a/src/main/java/com/adyen/model/payment/Phone.java +++ b/src/main/java/com/adyen/model/payment/Phone.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java index 79ac59c0e..7b3bf92b4 100644 --- a/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/payment/PlatformChargebackLogic.java @@ -3,7 +3,7 @@ * 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 @@ -52,7 +52,7 @@ public class PlatformChargebackLogic { /** - * Gets or Sets behavior + * The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. */ @JsonAdapter(BehaviorEnum.Adapter.class) public enum BehaviorEnum { @@ -122,10 +122,10 @@ public PlatformChargebackLogic behavior(BehaviorEnum behavior) { } /** - * Get behavior + * The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**. * @return behavior **/ - @ApiModelProperty(value = "") + @ApiModelProperty(value = "The method of handling the chargeback. Possible values: **deductFromLiableAccount**, **deductFromOneBalanceAccount**, **deductAccordingToSplitRatio**.") public BehaviorEnum getBehavior() { return behavior; @@ -144,10 +144,10 @@ public PlatformChargebackLogic costAllocationAccount(String costAllocationAccoun } /** - * Get costAllocationAccount + * The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account. * @return costAllocationAccount **/ - @ApiModelProperty(value = "") + @ApiModelProperty(value = "The unique identifier of the balance account to which the chargeback fees are booked. By default, the chargeback fees are booked to your liable balance account.") public String getCostAllocationAccount() { return costAllocationAccount; @@ -166,10 +166,10 @@ public PlatformChargebackLogic targetAccount(String targetAccount) { } /** - * Get targetAccount + * The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**. * @return targetAccount **/ - @ApiModelProperty(value = "") + @ApiModelProperty(value = "The unique identifier of the balance account against which the disputed amount is booked. Required if `behavior` is **deductFromOneBalanceAccount**.") public String getTargetAccount() { return targetAccount; diff --git a/src/main/java/com/adyen/model/payment/Recurring.java b/src/main/java/com/adyen/model/payment/Recurring.java index 8a8ce6540..c401d5796 100644 --- a/src/main/java/com/adyen/model/payment/Recurring.java +++ b/src/main/java/com/adyen/model/payment/Recurring.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/RefundRequest.java b/src/main/java/com/adyen/model/payment/RefundRequest.java index 4f4906805..e40f36b2d 100644 --- a/src/main/java/com/adyen/model/payment/RefundRequest.java +++ b/src/main/java/com/adyen/model/payment/RefundRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java index 8acb6c6fb..80f213828 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalData3DSecure.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java index 247d06a26..053ed399d 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataBillingAddress.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java index 6879b697c..d4d51d767 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCard.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java index 155e5f3f5..9977b583d 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataCommon.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java index 374ae67f5..e5b85c551 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataInstallments.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java index 99c0152b9..5c1cbde82 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataNetworkTokens.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java index efa8341d8..783e99367 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataOpi.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java index 1739bf2a6..0b833c7f8 100644 --- a/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payment/ResponseAdditionalDataSepa.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java index 8b6e05ba0..5951f3c43 100644 --- a/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/payment/SDKEphemPubKey.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ServiceError.java b/src/main/java/com/adyen/model/payment/ServiceError.java index 7ad243dd3..fcf883b3b 100644 --- a/src/main/java/com/adyen/model/payment/ServiceError.java +++ b/src/main/java/com/adyen/model/payment/ServiceError.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java index baa419a8f..ba4f2cdda 100644 --- a/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/payment/ShopperInteractionDevice.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/Split.java b/src/main/java/com/adyen/model/payment/Split.java index 2fab87f09..dc83c6607 100644 --- a/src/main/java/com/adyen/model/payment/Split.java +++ b/src/main/java/com/adyen/model/payment/Split.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/SplitAmount.java b/src/main/java/com/adyen/model/payment/SplitAmount.java index 315cd1e5c..9081b5d67 100644 --- a/src/main/java/com/adyen/model/payment/SplitAmount.java +++ b/src/main/java/com/adyen/model/payment/SplitAmount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/SubMerchant.java b/src/main/java/com/adyen/model/payment/SubMerchant.java index 08a46e3af..773bc166d 100644 --- a/src/main/java/com/adyen/model/payment/SubMerchant.java +++ b/src/main/java/com/adyen/model/payment/SubMerchant.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java index 5ec82da11..6021eab46 100644 --- a/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java +++ b/src/main/java/com/adyen/model/payment/TechnicalCancelRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDS1Result.java b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java index 7c426f2b7..103aa441d 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS1Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS1Result.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java index 3a3adfa98..0aeefaf79 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2RequestData.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2Result.java b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java index 34dbb77ec..a729e01a5 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2Result.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java index d92d73557..b341b1e8b 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java index b76fdb0f8..dd50e159c 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java +++ b/src/main/java/com/adyen/model/payment/ThreeDS2ResultResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java index 6762445c0..9a971c8ba 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorAuthenticationInfo.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java index da5d94ac9..af0bc024e 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSRequestorPriorAuthenticationInfo.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/ThreeDSecureData.java b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java index 23008884a..1058a8422 100644 --- a/src/main/java/com/adyen/model/payment/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/payment/ThreeDSecureData.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java index 0b82ed5cb..0b7793c2f 100644 --- a/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java +++ b/src/main/java/com/adyen/model/payment/VoidPendingRefundRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java index 8de6df217..f40bde553 100644 --- a/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/payout/AbstractOpenApiSchema.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/Address.java b/src/main/java/com/adyen/model/payout/Address.java index 7b47398f3..9c9dd991b 100644 --- a/src/main/java/com/adyen/model/payout/Address.java +++ b/src/main/java/com/adyen/model/payout/Address.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/Amount.java b/src/main/java/com/adyen/model/payout/Amount.java index cb9e846f7..c0b79bd9e 100644 --- a/src/main/java/com/adyen/model/payout/Amount.java +++ b/src/main/java/com/adyen/model/payout/Amount.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/BankAccount.java b/src/main/java/com/adyen/model/payout/BankAccount.java index eef7b6ba7..6b60d6b2d 100644 --- a/src/main/java/com/adyen/model/payout/BankAccount.java +++ b/src/main/java/com/adyen/model/payout/BankAccount.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/Card.java b/src/main/java/com/adyen/model/payout/Card.java index 05ef7b530..26d345ffc 100644 --- a/src/main/java/com/adyen/model/payout/Card.java +++ b/src/main/java/com/adyen/model/payout/Card.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/FraudCheckResult.java b/src/main/java/com/adyen/model/payout/FraudCheckResult.java index 6995a6657..d6cf33e85 100644 --- a/src/main/java/com/adyen/model/payout/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/payout/FraudCheckResult.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java index 49ac42fa2..758592aee 100644 --- a/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java +++ b/src/main/java/com/adyen/model/payout/FraudCheckResultWrapper.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/FraudResult.java b/src/main/java/com/adyen/model/payout/FraudResult.java index ef3c55bbd..f22cce7f6 100644 --- a/src/main/java/com/adyen/model/payout/FraudResult.java +++ b/src/main/java/com/adyen/model/payout/FraudResult.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/FundSource.java b/src/main/java/com/adyen/model/payout/FundSource.java index bd86c254a..2372bd199 100644 --- a/src/main/java/com/adyen/model/payout/FundSource.java +++ b/src/main/java/com/adyen/model/payout/FundSource.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/JSON.java b/src/main/java/com/adyen/model/payout/JSON.java index bfcdc59e5..7805832a8 100644 --- a/src/main/java/com/adyen/model/payout/JSON.java +++ b/src/main/java/com/adyen/model/payout/JSON.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ModifyRequest.java b/src/main/java/com/adyen/model/payout/ModifyRequest.java index 27b9b6265..0c0a9a0fc 100644 --- a/src/main/java/com/adyen/model/payout/ModifyRequest.java +++ b/src/main/java/com/adyen/model/payout/ModifyRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ModifyResponse.java b/src/main/java/com/adyen/model/payout/ModifyResponse.java index 5b3642c11..87c9303e2 100644 --- a/src/main/java/com/adyen/model/payout/ModifyResponse.java +++ b/src/main/java/com/adyen/model/payout/ModifyResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/Name.java b/src/main/java/com/adyen/model/payout/Name.java index 2a40b9184..ff3efa786 100644 --- a/src/main/java/com/adyen/model/payout/Name.java +++ b/src/main/java/com/adyen/model/payout/Name.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/PayoutRequest.java b/src/main/java/com/adyen/model/payout/PayoutRequest.java index 3b7930c4b..fafa1c82d 100644 --- a/src/main/java/com/adyen/model/payout/PayoutRequest.java +++ b/src/main/java/com/adyen/model/payout/PayoutRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/PayoutResponse.java b/src/main/java/com/adyen/model/payout/PayoutResponse.java index ffd25b50d..39c63112a 100644 --- a/src/main/java/com/adyen/model/payout/PayoutResponse.java +++ b/src/main/java/com/adyen/model/payout/PayoutResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/Recurring.java b/src/main/java/com/adyen/model/payout/Recurring.java index ce7b807f0..3157ff4dc 100644 --- a/src/main/java/com/adyen/model/payout/Recurring.java +++ b/src/main/java/com/adyen/model/payout/Recurring.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java index 1c462144a..0a4915f6a 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalData3DSecure.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java index 652b82390..8597a5d3f 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataBillingAddress.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java index 06fa4adcf..b2f0cbe15 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCard.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java index dc2888bb5..3c4e11b80 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataCommon.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java index 9131ec0d1..7e2caa00a 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataInstallments.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java index d83227a09..f855685bb 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataNetworkTokens.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java index 83105ec76..eadac8395 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataOpi.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java index a97dd8701..67a759763 100644 --- a/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/payout/ResponseAdditionalDataSepa.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/ServiceError.java b/src/main/java/com/adyen/model/payout/ServiceError.java index 1d4311b0c..215cee30c 100644 --- a/src/main/java/com/adyen/model/payout/ServiceError.java +++ b/src/main/java/com/adyen/model/payout/ServiceError.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java index fee165962..6af8a9988 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java index a4cc61d82..67c248950 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailAndSubmitResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java index 827ea52ca..81266bcb7 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailRequest.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/StoreDetailResponse.java b/src/main/java/com/adyen/model/payout/StoreDetailResponse.java index aa3eb0ef9..f81c81979 100644 --- a/src/main/java/com/adyen/model/payout/StoreDetailResponse.java +++ b/src/main/java/com/adyen/model/payout/StoreDetailResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/SubmitRequest.java b/src/main/java/com/adyen/model/payout/SubmitRequest.java index 3c3a5d765..f805a037c 100644 --- a/src/main/java/com/adyen/model/payout/SubmitRequest.java +++ b/src/main/java/com/adyen/model/payout/SubmitRequest.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/payout/SubmitResponse.java b/src/main/java/com/adyen/model/payout/SubmitResponse.java index 312b4a2e8..aa2fe3a1a 100644 --- a/src/main/java/com/adyen/model/payout/SubmitResponse.java +++ b/src/main/java/com/adyen/model/payout/SubmitResponse.java @@ -2,7 +2,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java index 961897ed1..b4668ace5 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/Address.java b/src/main/java/com/adyen/model/posterminalmanagement/Address.java index 58beb6d9d..a638892dc 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/Address.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/Address.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java index d8d7b9987..36aa9ae64 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java index f298e3c8c..a9ac96758 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/AssignTerminalsResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java index 009b7872a..33ac58d39 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java index bf814ec3c..d2774484c 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/FindTerminalResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java index 9d5e54659..3908421bc 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java index 2243c8a29..eecf633ad 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetStoresUnderAccountResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java index fff438a90..ae91a62a6 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java index 42eab77b0..d2f5b97f9 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalDetailsResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java index 92c701a9b..367a91e69 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java index 35f92d6a5..6454afce7 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/GetTerminalsUnderAccountResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/JSON.java b/src/main/java/com/adyen/model/posterminalmanagement/JSON.java index 25e33d65b..53e1bad0f 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/JSON.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java b/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java index 004107517..3188e659a 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/MerchantAccount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java b/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java index e1e329fb9..7d7453179 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/ServiceError.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/posterminalmanagement/Store.java b/src/main/java/com/adyen/model/posterminalmanagement/Store.java index 0e0c183af..d9eaba839 100644 --- a/src/main/java/com/adyen/model/posterminalmanagement/Store.java +++ b/src/main/java/com/adyen/model/posterminalmanagement/Store.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java index df4fbb1f5..c4104019c 100644 --- a/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/recurring/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/Address.java b/src/main/java/com/adyen/model/recurring/Address.java index 4ce52fa89..cbe4b9587 100644 --- a/src/main/java/com/adyen/model/recurring/Address.java +++ b/src/main/java/com/adyen/model/recurring/Address.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/Amount.java b/src/main/java/com/adyen/model/recurring/Amount.java index 7195b5569..fcaa8cb4a 100644 --- a/src/main/java/com/adyen/model/recurring/Amount.java +++ b/src/main/java/com/adyen/model/recurring/Amount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/BankAccount.java b/src/main/java/com/adyen/model/recurring/BankAccount.java index 8c05d0f82..d52e2d567 100644 --- a/src/main/java/com/adyen/model/recurring/BankAccount.java +++ b/src/main/java/com/adyen/model/recurring/BankAccount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/Card.java b/src/main/java/com/adyen/model/recurring/Card.java index c9c62f046..2b40e2642 100644 --- a/src/main/java/com/adyen/model/recurring/Card.java +++ b/src/main/java/com/adyen/model/recurring/Card.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java index e0a24435f..9af351884 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java index 6d9ceb8b9..ff65d0cc1 100644 --- a/src/main/java/com/adyen/model/recurring/CreatePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/CreatePermitResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java index 16603f7de..8c3de84ea 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java index 404ec5ec1..a3ca8b05c 100644 --- a/src/main/java/com/adyen/model/recurring/DisablePermitResult.java +++ b/src/main/java/com/adyen/model/recurring/DisablePermitResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/DisableRequest.java b/src/main/java/com/adyen/model/recurring/DisableRequest.java index 914ce8ea1..c16540c83 100644 --- a/src/main/java/com/adyen/model/recurring/DisableRequest.java +++ b/src/main/java/com/adyen/model/recurring/DisableRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/DisableResult.java b/src/main/java/com/adyen/model/recurring/DisableResult.java index a688ecfa0..142011e5a 100644 --- a/src/main/java/com/adyen/model/recurring/DisableResult.java +++ b/src/main/java/com/adyen/model/recurring/DisableResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/JSON.java b/src/main/java/com/adyen/model/recurring/JSON.java index 566a7199a..b809f947e 100644 --- a/src/main/java/com/adyen/model/recurring/JSON.java +++ b/src/main/java/com/adyen/model/recurring/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/Name.java b/src/main/java/com/adyen/model/recurring/Name.java index eae8c7275..57013fde3 100644 --- a/src/main/java/com/adyen/model/recurring/Name.java +++ b/src/main/java/com/adyen/model/recurring/Name.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java index 563d87d2a..679856686 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java index 2ec7dfd7d..c9ec03dcb 100644 --- a/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java +++ b/src/main/java/com/adyen/model/recurring/NotifyShopperResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/Permit.java b/src/main/java/com/adyen/model/recurring/Permit.java index 71593679c..553128b68 100644 --- a/src/main/java/com/adyen/model/recurring/Permit.java +++ b/src/main/java/com/adyen/model/recurring/Permit.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/PermitRestriction.java b/src/main/java/com/adyen/model/recurring/PermitRestriction.java index 9e6656097..fbd37853d 100644 --- a/src/main/java/com/adyen/model/recurring/PermitRestriction.java +++ b/src/main/java/com/adyen/model/recurring/PermitRestriction.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/PermitResult.java b/src/main/java/com/adyen/model/recurring/PermitResult.java index 60727f861..5f13a0242 100644 --- a/src/main/java/com/adyen/model/recurring/PermitResult.java +++ b/src/main/java/com/adyen/model/recurring/PermitResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/Recurring.java b/src/main/java/com/adyen/model/recurring/Recurring.java index 67e5c12b4..522d1986b 100644 --- a/src/main/java/com/adyen/model/recurring/Recurring.java +++ b/src/main/java/com/adyen/model/recurring/Recurring.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetail.java b/src/main/java/com/adyen/model/recurring/RecurringDetail.java index 003d4bb41..5a7373eda 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetail.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetail.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java index a16f1170e..bfd02f581 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailWrapper.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java index b44ddcc10..8a09041af 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java index 4aa049d4d..594afc897 100644 --- a/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java +++ b/src/main/java/com/adyen/model/recurring/RecurringDetailsResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java index 3a33cf993..0b9fa46cd 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java index 5faf33f33..2a7ac8b68 100644 --- a/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java +++ b/src/main/java/com/adyen/model/recurring/ScheduleAccountUpdaterResult.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/ServiceError.java b/src/main/java/com/adyen/model/recurring/ServiceError.java index 58eb574b8..213334c34 100644 --- a/src/main/java/com/adyen/model/recurring/ServiceError.java +++ b/src/main/java/com/adyen/model/recurring/ServiceError.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/recurring/TokenDetails.java b/src/main/java/com/adyen/model/recurring/TokenDetails.java index 62f4d269a..7315e9e84 100644 --- a/src/main/java/com/adyen/model/recurring/TokenDetails.java +++ b/src/main/java/com/adyen/model/recurring/TokenDetails.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java index 077a73f02..92a137854 100644 --- a/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/Amount.java b/src/main/java/com/adyen/model/storedvalue/Amount.java index 12c16ae5b..4c1433f08 100644 --- a/src/main/java/com/adyen/model/storedvalue/Amount.java +++ b/src/main/java/com/adyen/model/storedvalue/Amount.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/JSON.java b/src/main/java/com/adyen/model/storedvalue/JSON.java index 6d3ad8dac..236c8ee47 100644 --- a/src/main/java/com/adyen/model/storedvalue/JSON.java +++ b/src/main/java/com/adyen/model/storedvalue/JSON.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/ServiceError.java b/src/main/java/com/adyen/model/storedvalue/ServiceError.java index 2fa7f9492..344088216 100644 --- a/src/main/java/com/adyen/model/storedvalue/ServiceError.java +++ b/src/main/java/com/adyen/model/storedvalue/ServiceError.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java index eb99ae3df..4d988139a 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java index 4bfe679f3..506f2315e 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceCheckResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java index 21f4cf17d..eb605d16c 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java index ebda7ee95..c395c611f 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueBalanceMergeResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java index c23af062c..8140adf87 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java index 38dc9d180..ddd63926f 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueIssueResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java index 69d949118..3388be189 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java index 3ae589f5f..ea0882ab6 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueLoadResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java index 12b788066..5e68e661b 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java index c7e9d29d9..7c988a2c6 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueStatusChangeResponse.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java index f48dfa277..0fc8d4bc7 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidRequest.java @@ -3,7 +3,7 @@ * 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 diff --git a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java index 3bbff1b00..8fa22b886 100644 --- a/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java +++ b/src/main/java/com/adyen/model/storedvalue/StoredValueVoidResponse.java @@ -3,7 +3,7 @@ * 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 From 43a090112d0a9a07eca36d80859d6d129be957e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:40:49 +0200 Subject: [PATCH 07/15] fix(deps): update dependency io.swagger.core.v3:swagger-annotations to v2.2.11 (#1028) 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 f7af49905..71be325b0 100644 --- a/pom.xml +++ b/pom.xml @@ -220,7 +220,7 @@ io.swagger.core.v3 swagger-annotations - 2.2.9 + 2.2.11 compile From 3df19e7ffbafee01747f0f0f407b73e16b153c37 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:41:13 +0200 Subject: [PATCH 08/15] fix(deps): update dependency io.swagger:swagger-annotations to v1.6.11 (#1029) 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 71be325b0..80aa633f8 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ UTF-8 UTF-8 - 1.6.10 + 1.6.11 scm:git:git@github.com:Adyen/adyen-java-api-library.git From 674f72d74f6bc9fb7f966ed70e4092dd74660c45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:41:31 +0200 Subject: [PATCH 09/15] chore(deps): update dependency org.apache.felix:maven-bundle-plugin to v5.1.9 (#1034) 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 80aa633f8..abe324f46 100644 --- a/pom.xml +++ b/pom.xml @@ -162,7 +162,7 @@ org.apache.felix maven-bundle-plugin - 5.1.8 + 5.1.9 bundle-manifest From ebd19a5d32a64ee441e87613c5b1f84a92e83d1c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:41:58 +0200 Subject: [PATCH 10/15] chore(deps): update dependency org.apache.maven.plugins:maven-source-plugin to v3.3.0 (#1035) 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 abe324f46..8a1ead92e 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 attach-sources From 0b42a82902c448630911de9dbf88e586196cae1f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 08:42:15 +0200 Subject: [PATCH 11/15] chore(deps): update dependency org.apache.maven.plugins:maven-checkstyle-plugin to v3.3.0 (#1036) 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 8a1ead92e..649196330 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.2 + 3.3.0 checkstyle.xml checkstyle-suppressions.xml From d0c859103a3904a9d0cacb7e0b3fb5749745a4e9 Mon Sep 17 00:00:00 2001 From: Florian Agsteiner Date: Fri, 2 Jun 2023 09:01:34 +0200 Subject: [PATCH 12/15] Add SaleToAcquirerDataSerializer deserialisation (#1038) --- .../model/terminal/SaleToAcquirerData.java | 23 +++++++++++++++---- .../SaleToAcquirerDataSerializer.java | 21 +++++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/adyen/model/terminal/SaleToAcquirerData.java b/src/main/java/com/adyen/model/terminal/SaleToAcquirerData.java index cc1035424..cfaa6da9e 100644 --- a/src/main/java/com/adyen/model/terminal/SaleToAcquirerData.java +++ b/src/main/java/com/adyen/model/terminal/SaleToAcquirerData.java @@ -20,13 +20,18 @@ */ package com.adyen.model.terminal; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.Map; +import java.util.Objects; + +import org.apache.commons.codec.binary.Base64; + import com.adyen.model.applicationinfo.ApplicationInfo; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import org.apache.commons.codec.binary.Base64; - -import java.util.Map; -import java.util.Objects; public class SaleToAcquirerData { @@ -229,4 +234,14 @@ public String toBase64() { String json = PRETTY_PRINT_GSON.toJson(this); return new String(Base64.encodeBase64(json.getBytes())); } + + public static SaleToAcquirerData fromBase64(String base64) { + byte[] decoded = Base64.decodeBase64(base64); + try (Reader reader = new InputStreamReader(new ByteArrayInputStream(decoded))) { + return PRETTY_PRINT_GSON.fromJson(reader, SaleToAcquirerData.class); + } + catch (IOException e) { + throw new IllegalStateException(e); + } + } } diff --git a/src/main/java/com/adyen/serializer/SaleToAcquirerDataSerializer.java b/src/main/java/com/adyen/serializer/SaleToAcquirerDataSerializer.java index 0fcb79385..da134f28c 100644 --- a/src/main/java/com/adyen/serializer/SaleToAcquirerDataSerializer.java +++ b/src/main/java/com/adyen/serializer/SaleToAcquirerDataSerializer.java @@ -1,16 +1,29 @@ package com.adyen.serializer; +import java.lang.reflect.Type; + import com.adyen.model.terminal.SaleToAcquirerData; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSerializationContext; import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; - -public class SaleToAcquirerDataSerializer implements JsonSerializer { +public class SaleToAcquirerDataSerializer implements + JsonSerializer, + JsonDeserializer { - public JsonElement serialize(SaleToAcquirerData saleToAcquirerData, Type typeOfSrc, JsonSerializationContext context) { + @Override + public JsonElement serialize(SaleToAcquirerData saleToAcquirerData, Type typeOfSrc, + JsonSerializationContext context) { return new JsonPrimitive(saleToAcquirerData.toBase64()); } + + @Override + public SaleToAcquirerData deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException { + return SaleToAcquirerData.fromBase64(json.getAsString()); + } } From 7c952bdde936ad98f202e5ac8251329f4d3af84d Mon Sep 17 00:00:00 2001 From: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com> Date: Fri, 2 Jun 2023 13:09:38 +0200 Subject: [PATCH 13/15] bump version to v20.1.0 (#1045) --- README.md | 2 +- pom.xml | 2 +- src/main/java/com/adyen/Client.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7420a9cfa..1fb385519 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ You can use Maven and add this dependency to your project's POM: com.adyen adyen-java-api-library - 20.0.0 + 20.1.0 ``` diff --git a/pom.xml b/pom.xml index 649196330..97392d43a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.adyen adyen-java-api-library jar - 20.0.0 + 20.1.0 Adyen Java API Library Adyen API Client Library for Java https://github.com/adyen/adyen-java-api-library diff --git a/src/main/java/com/adyen/Client.java b/src/main/java/com/adyen/Client.java index 26a93c84b..ed6a7ae6c 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 = "20.0.0"; + public static final String LIB_VERSION = "20.1.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"; From ba0417689c10af14c6c76789d415aab977d5835e Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Thu, 8 Jun 2023 09:58:31 +0200 Subject: [PATCH 14/15] [ITT-572] Banking Webhooks (#1046) * add notification models * deserializer/hmac/readme * java clean * changed naming -> -Webhooks * dirs must be lowercase.. --- Makefile | 6 +- README.md | 32 +- .../AbstractOpenApiSchema.java | 144 ++ .../configurationwebhooks/AccountHolder.java | 583 +++++ .../AccountHolderCapability.java | 689 ++++++ .../AccountHolderNotificationData.java | 248 ++ .../AccountHolderNotificationRequest.java | 341 +++ .../AccountSupportingEntityCapability.java | 562 +++++ .../model/configurationwebhooks/Address.java | 391 ++++ .../model/configurationwebhooks/Amount.java | 252 +++ .../configurationwebhooks/Authentication.java | 281 +++ .../model/configurationwebhooks/Balance.java | 312 +++ .../configurationwebhooks/BalanceAccount.java | 617 +++++ .../BalanceAccountNotificationData.java | 248 ++ .../BalanceAccountNotificationRequest.java | 341 +++ .../BalancePlatformNotificationResponse.java | 214 ++ .../configurationwebhooks/BulkAddress.java | 486 ++++ .../model/configurationwebhooks/Card.java | 645 ++++++ .../CardConfiguration.java | 652 ++++++ .../configurationwebhooks/CardOrderItem.java | 443 ++++ .../CardOrderItemDeliveryStatus.java | 373 +++ .../CardOrderNotificationRequest.java | 341 +++ .../model/configurationwebhooks/Contact.java | 416 ++++ .../configurationwebhooks/ContactDetails.java | 325 +++ .../CronSweepSchedule.java | 311 +++ .../model/configurationwebhooks/Expiry.java | 247 ++ .../IbanAccountIdentification.java | 304 +++ .../model/configurationwebhooks/JSON.java | 442 ++++ .../configurationwebhooks/JSONObject.java | 266 +++ .../model/configurationwebhooks/JSONPath.java | 224 ++ .../model/configurationwebhooks/Name.java | 256 +++ .../PaymentInstrument.java | 638 ++++++ .../PaymentInstrumentBankAccount.java | 287 +++ .../PaymentInstrumentNotificationData.java | 248 ++ .../PaymentInstrumentReference.java | 222 ++ .../PaymentNotificationRequest.java | 341 +++ .../configurationwebhooks/PersonalData.java | 280 +++ .../model/configurationwebhooks/Phone.java | 306 +++ .../configurationwebhooks/PhoneNumber.java | 334 +++ .../model/configurationwebhooks/Resource.java | 277 +++ .../SweepConfiguration.java | 622 +++++ .../SweepConfigurationNotificationData.java | 281 +++ ...SweepConfigurationNotificationRequest.java | 343 +++ .../SweepConfigurationSchedule.java | 287 +++ .../SweepConfigurationV2.java | 730 ++++++ .../SweepCounterparty.java | 280 +++ .../configurationwebhooks/SweepSchedule.java | 270 +++ .../USLocalAccountIdentification.java | 421 ++++ .../reportwebhooks/AbstractOpenApiSchema.java | 144 ++ .../BalancePlatformNotificationResponse.java | 214 ++ .../com/adyen/model/reportwebhooks/JSON.java | 403 ++++ .../ReportNotificationData.java | 420 ++++ .../ReportNotificationRequest.java | 339 +++ .../adyen/model/reportwebhooks/Resource.java | 277 +++ .../reportwebhooks/ResourceReference.java | 280 +++ .../AULocalAccountIdentification.java | 338 +++ .../AbstractOpenApiSchema.java | 144 ++ .../AdditionalBankIdentification.java | 297 +++ .../adyen/model/transferwebhooks/Address.java | 387 ++++ .../adyen/model/transferwebhooks/Amount.java | 252 +++ .../transferwebhooks/AmountAdjustment.java | 331 +++ .../BRLocalAccountIdentification.java | 372 +++ .../transferwebhooks/BalanceMutation.java | 301 +++ .../BalancePlatformNotificationResponse.java | 214 ++ .../model/transferwebhooks/BankAccountV3.java | 258 +++ .../BankAccountV3AccountIdentification.java | 936 ++++++++ .../CALocalAccountIdentification.java | 455 ++++ .../CZLocalAccountIdentification.java | 338 +++ .../transferwebhooks/CounterpartyV3.java | 315 +++ .../DKLocalAccountIdentification.java | 338 +++ .../HULocalAccountIdentification.java | 304 +++ .../IbanAccountIdentification.java | 304 +++ .../adyen/model/transferwebhooks/JSON.java | 437 ++++ .../model/transferwebhooks/MerchantData.java | 314 +++ .../NOLocalAccountIdentification.java | 304 +++ .../model/transferwebhooks/NameLocation.java | 379 ++++ .../NumberAndBicAccountIdentification.java | 372 +++ .../PLLocalAccountIdentification.java | 304 +++ .../transferwebhooks/PartyIdentification.java | 470 ++++ .../transferwebhooks/PaymentInstrument.java | 313 +++ .../RelayedAuthorisationData.java | 254 +++ .../model/transferwebhooks/Resource.java | 277 +++ .../transferwebhooks/ResourceReference.java | 280 +++ .../SELocalAccountIdentification.java | 338 +++ .../SGLocalAccountIdentification.java | 337 +++ .../TransactionEventViolation.java | 282 +++ .../TransactionRuleReference.java | 280 +++ .../TransactionRuleSource.java | 247 ++ .../TransactionRulesResult.java | 324 +++ .../model/transferwebhooks/TransferEvent.java | 922 ++++++++ .../TransferNotificationData.java | 2007 +++++++++++++++++ .../TransferNotificationRequest.java | 340 +++ .../TransferNotificationTransferTracking.java | 292 +++ .../TransferNotificationValidationFact.java | 247 ++ .../UKLocalAccountIdentification.java | 338 +++ .../USLocalAccountIdentification.java | 421 ++++ .../notification/BankingWebhookHandler.java | 104 + .../java/com/adyen/util/HMACValidator.java | 8 + src/test/java/com/adyen/WebhookTest.java | 36 +- 99 files changed, 35337 insertions(+), 10 deletions(-) create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Address.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Amount.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Authentication.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Balance.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Card.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Contact.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/CronSweepSchedule.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Expiry.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/JSON.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/JSONObject.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/JSONPath.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Name.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentBankAccount.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentReference.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PersonalData.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Phone.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/Resource.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepConfiguration.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationSchedule.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java create mode 100644 src/main/java/com/adyen/model/configurationwebhooks/USLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/JSON.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/Resource.java create mode 100644 src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/AbstractOpenApiSchema.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/Address.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/Amount.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/JSON.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/MerchantData.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/NameLocation.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/Resource.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransferNotificationData.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransferNotificationTransferTracking.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java create mode 100644 src/main/java/com/adyen/notification/BankingWebhookHandler.java diff --git a/Makefile b/Makefile index cccb962c4..6ee5c38e7 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ openapi-generator-cli:=java -jar $(openapi-generator-jar) generator:=java library:=okhttp-gson -modelGen:=balancecontrol balanceplatform binlookup capital checkout dataprotection legalentitymanagement management payment payout posterminalmanagement recurring transfers storedvalue +modelGen:=balancecontrol balanceplatform binlookup capital checkout dataprotection legalentitymanagement management payment payout posterminalmanagement recurring transfers storedvalue configurationwebhooks reportwebhooks transferwebhooks models:=src/main/java/com/adyen/model output:=target/out @@ -40,6 +40,10 @@ marketpay/fund: spec=FundService-v6 marketpay/configuration: spec=NotificationConfigurationService-v6 marketpay/webhooks: spec=MarketPayNotificationService-v6 hop: spec=HopService-v6 +# Balance Webhooks +configurationwebhooks: spec=BalancePlatformConfigurationNotification-v1 +reportwebhooks: spec=BalancePlatformReportNotification-v1 +transferwebhooks: spec=BalancePlatformTransferNotification-v3 $(modelGen): target/spec $(openapi-generator-jar) rm -rf $(models)/$@ $(output) diff --git a/README.md b/README.md index 1fb385519..8904103d9 100644 --- a/README.md +++ b/README.md @@ -10,12 +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/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** | +| [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/3/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** | @@ -24,12 +24,21 @@ The Library supports all APIs under the following services: | [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead. | Fund | **v6** | | [Hosted onboarding API](https://docs.adyen.com/api-explorer/#/Hop/v6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead. | Hop | **v6** | | [Notification Configuration API](https://docs.adyen.com/api-explorer/#/NotificationConfigurationService/v6/overview) | This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead. | Notification | **v6** | -| [Platforms Notifications Webhooks](https://docs.adyen.com/api-explorer/#/NotificationService/v6/overview) | | *Models only* | **v6** | +| [Platforms Notifications Webhooks](https://docs.adyen.com/api-explorer/#/NotificationService/v6/overview) | | *Models only* | **v6** | | [POS Terminal Management API](https://docs.adyen.com/api-explorer/#/postfmapi/v1/overview) | Endpoints for managing your point-of-sale payment terminals. | TerminalManagement | **v1** | | [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v68/overview) | Endpoints for managing saved payment details. | Recurring | **v68** | | [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | StoredValue | **v46** | | [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | Transfers | **v3** | | [Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen uses webhooks to send notifications about payment status updates, newly available reports, and other events that can be subscribed to. For more information, refer to our [documentation](https://docs.adyen.com/development-resources/webhooks). | *Models only* | **v1** | +## Supported Webhook versions +The library supports all webhooks under the following model directories: + +| Webhooks | Description | Model Name | Supported Version | +|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|-------------------| +| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationNotification](src/main/java/com/adyen/model/configurationNotification) | **v1** | +| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/3/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransferNotification](src/main/java/com/adyen/model/transferNotification) | **v3** | +| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportNotification](src/main/java/com/adyen/model/reportNotification) | **v1** | +| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](src/main/java/com/adyen/model/notification) | **v1** | For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/). @@ -157,6 +166,19 @@ if (notificationRequestItem.isPresent()) { } } ~~~~ +Or if you would like to deserialize the Banking Webhooks, first check if the payload is authentic: +~~~~ java +String payload = "WEBHOOK_PAYLOAD"; +String signKey = "SIGNATURE_RETREIVED_FROM_CA"; +String hmacKey = "HMACKEY_RETREIVED_FROM_WEBHOOK_HEADER"; +HMACValidator hmacValidator = new HMACValidator(); +boolean authenticity = hmacValidator.validateHMAC(hmacKey, signKey, payload); +~~~~ +If this bool returns true, one can proceed to deserialize against the desired webhook type: +~~~~ java +BankingWebhookHandler webhookHandler = new BankingWebhookHandler(); +AccountHolderNotificationRequest accountHolderNotificationRequest = webhookHandler.getAccountHolderNotificationRequest(payload); +~~~~ ### Proxy configuration You can configure a proxy connection by injecting your own AdyenHttpClient on your client instance. diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/configurationwebhooks/AbstractOpenApiSchema.java new file mode 100644 index 000000000..d1e9157a6 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/AbstractOpenApiSchema.java @@ -0,0 +1,144 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +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/configurationwebhooks/AccountHolder.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java new file mode 100644 index 000000000..8ca3c55ec --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolder.java @@ -0,0 +1,583 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.AccountHolderCapability; +import com.adyen.model.configurationwebhooks.ContactDetails; +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * AccountHolder + */ + +public class AccountHolder { + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_CAPABILITIES = "capabilities"; + @SerializedName(SERIALIZED_NAME_CAPABILITIES) + private Map capabilities = null; + + public static final String SERIALIZED_NAME_CONTACT_DETAILS = "contactDetails"; + @SerializedName(SERIALIZED_NAME_CONTACT_DETAILS) + private ContactDetails contactDetails; + + 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_LEGAL_ENTITY_ID = "legalEntityId"; + @SerializedName(SERIALIZED_NAME_LEGAL_ENTITY_ID) + private String legalEntityId; + + public static final String SERIALIZED_NAME_PRIMARY_BALANCE_ACCOUNT = "primaryBalanceAccount"; + @SerializedName(SERIALIZED_NAME_PRIMARY_BALANCE_ACCOUNT) + private String primaryBalanceAccount; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + /** + * The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone. + */ + @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 AccountHolder() { + } + + public AccountHolder balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public AccountHolder capabilities(Map capabilities) { + + this.capabilities = capabilities; + return this; + } + + public AccountHolder putCapabilitiesItem(String key, AccountHolderCapability capabilitiesItem) { + if (this.capabilities == null) { + this.capabilities = new HashMap<>(); + } + this.capabilities.put(key, capabilitiesItem); + return this; + } + + /** + * Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + * @return capabilities + **/ + @ApiModelProperty(value = "Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability.") + + public Map getCapabilities() { + return capabilities; + } + + + public void setCapabilities(Map capabilities) { + this.capabilities = capabilities; + } + + + public AccountHolder contactDetails(ContactDetails contactDetails) { + + this.contactDetails = contactDetails; + return this; + } + + /** + * Get contactDetails + * @return contactDetails + **/ + @ApiModelProperty(value = "") + + public ContactDetails getContactDetails() { + return contactDetails; + } + + + public void setContactDetails(ContactDetails contactDetails) { + this.contactDetails = contactDetails; + } + + + public AccountHolder description(String description) { + + this.description = description; + return this; + } + + /** + * Your description for the account holder, maximum 300 characters. + * @return description + **/ + @ApiModelProperty(value = "Your description for the account holder, maximum 300 characters.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public AccountHolder id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the account holder. + * @return id + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the account holder.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public AccountHolder legalEntityId(String legalEntityId) { + + this.legalEntityId = legalEntityId; + return this; + } + + /** + * 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#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; + } + + + public void setLegalEntityId(String legalEntityId) { + this.legalEntityId = legalEntityId; + } + + + public AccountHolder primaryBalanceAccount(String primaryBalanceAccount) { + + this.primaryBalanceAccount = primaryBalanceAccount; + return this; + } + + /** + * The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + * @return primaryBalanceAccount + **/ + @ApiModelProperty(value = "The ID of the account holder's primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request.") + + public String getPrimaryBalanceAccount() { + return primaryBalanceAccount; + } + + + public void setPrimaryBalanceAccount(String primaryBalanceAccount) { + this.primaryBalanceAccount = primaryBalanceAccount; + } + + + public AccountHolder reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your reference for the account holder, maximum 150 characters. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the account holder, maximum 150 characters.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public AccountHolder status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone. + * @return status + **/ + @ApiModelProperty(value = "The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Inactive (Deprecated)**: The account holder is temporarily inactive due to missing KYC details. You can set the account back to active by providing the missing KYC details. * **Suspended**: The account holder is permanently deactivated by Adyen. This action cannot be undone. * **Closed**: The account holder is permanently deactivated by you. This action cannot be undone.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public AccountHolder timeZone(String timeZone) { + + this.timeZone = timeZone; + return this; + } + + /** + * The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + * @return timeZone + **/ + @ApiModelProperty(value = "The time zone of the account holder. For example, **Europe/Amsterdam**. Defaults to the time zone of the balance platform if no time zone is set. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).") + + 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; + } + AccountHolder accountHolder = (AccountHolder) o; + return Objects.equals(this.balancePlatform, accountHolder.balancePlatform) && + Objects.equals(this.capabilities, accountHolder.capabilities) && + Objects.equals(this.contactDetails, accountHolder.contactDetails) && + Objects.equals(this.description, accountHolder.description) && + Objects.equals(this.id, accountHolder.id) && + Objects.equals(this.legalEntityId, accountHolder.legalEntityId) && + Objects.equals(this.primaryBalanceAccount, accountHolder.primaryBalanceAccount) && + Objects.equals(this.reference, accountHolder.reference) && + Objects.equals(this.status, accountHolder.status) && + Objects.equals(this.timeZone, accountHolder.timeZone); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, capabilities, contactDetails, description, id, legalEntityId, primaryBalanceAccount, reference, status, timeZone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountHolder {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" capabilities: ").append(toIndentedString(capabilities)).append("\n"); + sb.append(" contactDetails: ").append(toIndentedString(contactDetails)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" legalEntityId: ").append(toIndentedString(legalEntityId)).append("\n"); + sb.append(" primaryBalanceAccount: ").append(toIndentedString(primaryBalanceAccount)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append("}"); + 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("balancePlatform"); + openapiFields.add("capabilities"); + openapiFields.add("contactDetails"); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("legalEntityId"); + openapiFields.add("primaryBalanceAccount"); + openapiFields.add("reference"); + openapiFields.add("status"); + openapiFields.add("timeZone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("legalEntityId"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolder.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccountHolder + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccountHolder.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccountHolder is not found in the empty JSON string", AccountHolder.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AccountHolder.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolder` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccountHolder.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 balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field `contactDetails` + if (jsonObj.getAsJsonObject("contactDetails") != null) { + ContactDetails.validateJsonObject(jsonObj.getAsJsonObject("contactDetails")); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field legalEntityId + if (jsonObj.get("legalEntityId") != null && !jsonObj.get("legalEntityId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `legalEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("legalEntityId").toString())); + } + // validate the optional field primaryBalanceAccount + if (jsonObj.get("primaryBalanceAccount") != null && !jsonObj.get("primaryBalanceAccount").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `primaryBalanceAccount` to be a primitive type in the JSON string but got `%s`", jsonObj.get("primaryBalanceAccount").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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 (!AccountHolder.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountHolder' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccountHolder.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountHolder value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountHolder read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccountHolder given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountHolder + * @throws IOException if the JSON string is invalid with respect to AccountHolder + */ + public static AccountHolder fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountHolder.class); + } + + /** + * Convert an instance of AccountHolder to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java new file mode 100644 index 000000000..d84252d83 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderCapability.java @@ -0,0 +1,689 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.AccountSupportingEntityCapability; +import com.adyen.model.configurationwebhooks.JSONObject; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * AccountHolderCapability + */ + +public class AccountHolderCapability { + 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_ALLOWED_SETTINGS = "allowedSettings"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SETTINGS) + private JSONObject allowedSettings; + + public static final String SERIALIZED_NAME_ENABLED = "enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + private Boolean enabled; + + 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; + + /** + * 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; + + public static final String SERIALIZED_NAME_REQUESTED_SETTINGS = "requestedSettings"; + @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. + */ + @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 AccountHolderCapability() { + } + + public AccountHolderCapability allowed(Boolean allowed) { + + this.allowed = allowed; + return this; + } + + /** + * Indicates whether the 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 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; + } + + + public void setAllowed(Boolean allowed) { + this.allowed = allowed; + } + + + public AccountHolderCapability allowedLevel(AllowedLevelEnum allowedLevel) { + + this.allowedLevel = allowedLevel; + return this; + } + + /** + * 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 void setAllowedLevel(AllowedLevelEnum allowedLevel) { + this.allowedLevel = allowedLevel; + } + + + public AccountHolderCapability allowedSettings(JSONObject allowedSettings) { + + this.allowedSettings = allowedSettings; + return this; + } + + /** + * Get allowedSettings + * @return allowedSettings + **/ + @ApiModelProperty(value = "") + + public JSONObject getAllowedSettings() { + return allowedSettings; + } + + + public void setAllowedSettings(JSONObject allowedSettings) { + this.allowedSettings = allowedSettings; + } + + + public AccountHolderCapability 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; + } + + + public AccountHolderCapability problems(List problems) { + + this.problems = problems; + return this; + } + + public AccountHolderCapability addProblemsItem(Object problemsItem) { + if (this.problems == null) { + this.problems = new ArrayList<>(); + } + this.problems.add(problemsItem); + return this; + } + + /** + * 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; + } + + + public void setProblems(List problems) { + this.problems = problems; + } + + + public AccountHolderCapability 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 AccountHolderCapability 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; + } + + + public AccountHolderCapability requestedSettings(JSONObject requestedSettings) { + + this.requestedSettings = requestedSettings; + return this; + } + + /** + * Get requestedSettings + * @return requestedSettings + **/ + @ApiModelProperty(value = "") + + public JSONObject getRequestedSettings() { + return requestedSettings; + } + + + public void setRequestedSettings(JSONObject requestedSettings) { + this.requestedSettings = 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; + } + + + public AccountHolderCapability verificationStatus(VerificationStatusEnum verificationStatus) { + + this.verificationStatus = verificationStatus; + return this; + } + + /** + * 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 + **/ + @ApiModelProperty(value = "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. ") + + public VerificationStatusEnum getVerificationStatus() { + return verificationStatus; + } + + + public void setVerificationStatus(VerificationStatusEnum verificationStatus) { + this.verificationStatus = verificationStatus; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountHolderCapability accountHolderCapability = (AccountHolderCapability) o; + return Objects.equals(this.allowed, accountHolderCapability.allowed) && + Objects.equals(this.allowedLevel, accountHolderCapability.allowedLevel) && + Objects.equals(this.allowedSettings, accountHolderCapability.allowedSettings) && + Objects.equals(this.enabled, accountHolderCapability.enabled) && + Objects.equals(this.problems, accountHolderCapability.problems) && + 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, transferInstruments, verificationStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountHolderCapability {\n"); + 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(" enabled: ").append(toIndentedString(enabled)).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"); + sb.append(" transferInstruments: ").append(toIndentedString(transferInstruments)).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("allowedSettings"); + openapiFields.add("enabled"); + openapiFields.add("problems"); + openapiFields.add("requested"); + openapiFields.add("requestedLevel"); + openapiFields.add("requestedSettings"); + openapiFields.add("transferInstruments"); + openapiFields.add("verificationStatus"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolderCapability.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccountHolderCapability + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccountHolderCapability.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccountHolderCapability is not found in the empty JSON string", AccountHolderCapability.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AccountHolderCapability.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolderCapability` properties.", entry.getKey())); + } + } + // 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 `allowedSettings` + if (jsonObj.getAsJsonObject("allowedSettings") != null) { + JSONObject.validateJsonObject(jsonObj.getAsJsonObject("allowedSettings")); + } + // ensure the json data is an array + if (jsonObj.get("problems") != null && !jsonObj.get("problems").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `problems` to be an array in the JSON string but got `%s`", jsonObj.get("problems").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()); + } + // validate the optional field `requestedSettings` + 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()) { + 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 (!AccountHolderCapability.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountHolderCapability' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccountHolderCapability.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountHolderCapability value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountHolderCapability read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccountHolderCapability given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountHolderCapability + * @throws IOException if the JSON string is invalid with respect to AccountHolderCapability + */ + public static AccountHolderCapability fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountHolderCapability.class); + } + + /** + * Convert an instance of AccountHolderCapability to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java new file mode 100644 index 000000000..d01ce7f9d --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationData.java @@ -0,0 +1,248 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.AccountHolder; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * AccountHolderNotificationData + */ + +public class AccountHolderNotificationData { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER = "accountHolder"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER) + private AccountHolder accountHolder; + + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public AccountHolderNotificationData() { + } + + public AccountHolderNotificationData accountHolder(AccountHolder accountHolder) { + + this.accountHolder = accountHolder; + return this; + } + + /** + * Get accountHolder + * @return accountHolder + **/ + @ApiModelProperty(value = "") + + public AccountHolder getAccountHolder() { + return accountHolder; + } + + + public void setAccountHolder(AccountHolder accountHolder) { + this.accountHolder = accountHolder; + } + + + public AccountHolderNotificationData balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountHolderNotificationData accountHolderNotificationData = (AccountHolderNotificationData) o; + return Objects.equals(this.accountHolder, accountHolderNotificationData.accountHolder) && + Objects.equals(this.balancePlatform, accountHolderNotificationData.balancePlatform); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolder, balancePlatform); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountHolderNotificationData {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).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("accountHolder"); + openapiFields.add("balancePlatform"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolderNotificationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccountHolderNotificationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccountHolderNotificationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccountHolderNotificationData is not found in the empty JSON string", AccountHolderNotificationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AccountHolderNotificationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolderNotificationData` properties.", entry.getKey())); + } + } + // validate the optional field `accountHolder` + if (jsonObj.getAsJsonObject("accountHolder") != null) { + AccountHolder.validateJsonObject(jsonObj.getAsJsonObject("accountHolder")); + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AccountHolderNotificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountHolderNotificationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccountHolderNotificationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountHolderNotificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountHolderNotificationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccountHolderNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountHolderNotificationData + * @throws IOException if the JSON string is invalid with respect to AccountHolderNotificationData + */ + public static AccountHolderNotificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountHolderNotificationData.class); + } + + /** + * Convert an instance of AccountHolderNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java new file mode 100644 index 000000000..de8a75310 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountHolderNotificationRequest.java @@ -0,0 +1,341 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.AccountHolderNotificationData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * AccountHolderNotificationRequest + */ + +public class AccountHolderNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private AccountHolderNotificationData data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * Type of notification. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + UPDATED("balancePlatform.accountHolder.updated"), + + CREATED("balancePlatform.accountHolder.created"); + + 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 AccountHolderNotificationRequest() { + } + + public AccountHolderNotificationRequest data(AccountHolderNotificationData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public AccountHolderNotificationData getData() { + return data; + } + + + public void setData(AccountHolderNotificationData data) { + this.data = data; + } + + + public AccountHolderNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public AccountHolderNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of notification. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of notification.") + + 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; + } + AccountHolderNotificationRequest accountHolderNotificationRequest = (AccountHolderNotificationRequest) o; + return Objects.equals(this.data, accountHolderNotificationRequest.data) && + Objects.equals(this.environment, accountHolderNotificationRequest.environment) && + Objects.equals(this.type, accountHolderNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountHolderNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountHolderNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AccountHolderNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AccountHolderNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AccountHolderNotificationRequest is not found in the empty JSON string", AccountHolderNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AccountHolderNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountHolderNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccountHolderNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + AccountHolderNotificationData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!AccountHolderNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountHolderNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccountHolderNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AccountHolderNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AccountHolderNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccountHolderNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountHolderNotificationRequest + * @throws IOException if the JSON string is invalid with respect to AccountHolderNotificationRequest + */ + public static AccountHolderNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountHolderNotificationRequest.class); + } + + /** + * Convert an instance of AccountHolderNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java b/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java new file mode 100644 index 000000000..aef07aae3 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/AccountSupportingEntityCapability.java @@ -0,0 +1,562 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.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 allowed(Boolean allowed) { + + this.allowed = allowed; + return this; + } + + /** + * 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; + } + + + public void setAllowed(Boolean allowed) { + this.allowed = allowed; + } + + + public AccountSupportingEntityCapability allowedLevel(AllowedLevelEnum allowedLevel) { + + this.allowedLevel = allowedLevel; + return this; + } + + /** + * 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 void setAllowedLevel(AllowedLevelEnum allowedLevel) { + this.allowedLevel = 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; + } + + + public AccountSupportingEntityCapability id(String id) { + + this.id = id; + return this; + } + + /** + * The ID of the supporting entity. + * @return id + **/ + @ApiModelProperty(value = "The ID of the supporting entity.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = 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; + } + + + public AccountSupportingEntityCapability verificationStatus(VerificationStatusEnum verificationStatus) { + + this.verificationStatus = verificationStatus; + return this; + } + + /** + * 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; + } + + + public void setVerificationStatus(VerificationStatusEnum verificationStatus) { + this.verificationStatus = 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(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AccountSupportingEntityCapability.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AccountSupportingEntityCapability` properties.", entry.getKey())); + } + } + // 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // 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/configurationwebhooks/Address.java b/src/main/java/com/adyen/model/configurationwebhooks/Address.java new file mode 100644 index 000000000..4b65a3186 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Address.java @@ -0,0 +1,391 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Address + */ + +public class Address { + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; + @SerializedName(SERIALIZED_NAME_HOUSE_NUMBER_OR_NAME) + private String houseNumberOrName; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + private String postalCode; + + public static final String SERIALIZED_NAME_STATE_OR_PROVINCE = "stateOrProvince"; + @SerializedName(SERIALIZED_NAME_STATE_OR_PROVINCE) + private String stateOrProvince; + + public static final String SERIALIZED_NAME_STREET = "street"; + @SerializedName(SERIALIZED_NAME_STREET) + private String street; + + public Address() { + } + + public Address city(String city) { + + this.city = city; + return this; + } + + /** + * The name of the city. Maximum length: 3000 characters. + * @return city + **/ + @ApiModelProperty(required = true, value = "The name of the city. Maximum length: 3000 characters.") + + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + public Address country(String country) { + + this.country = country; + return this; + } + + /** + * 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`. + * @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`.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public Address houseNumberOrName(String houseNumberOrName) { + + this.houseNumberOrName = houseNumberOrName; + return this; + } + + /** + * The number or name of the house. Maximum length: 3000 characters. + * @return houseNumberOrName + **/ + @ApiModelProperty(required = true, value = "The number or name of the house. Maximum length: 3000 characters.") + + public String getHouseNumberOrName() { + return houseNumberOrName; + } + + + public void setHouseNumberOrName(String houseNumberOrName) { + this.houseNumberOrName = houseNumberOrName; + } + + + public Address postalCode(String postalCode) { + + this.postalCode = postalCode; + return this; + } + + /** + * A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + * @return postalCode + **/ + @ApiModelProperty(required = true, value = "A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries.") + + public String getPostalCode() { + return postalCode; + } + + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + + public Address stateOrProvince(String stateOrProvince) { + + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * @return stateOrProvince + **/ + @ApiModelProperty(value = "The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.") + + public String getStateOrProvince() { + return stateOrProvince; + } + + + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + + public Address street(String street) { + + this.street = street; + return this; + } + + /** + * The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + * @return street + **/ + @ApiModelProperty(required = true, value = "The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`.") + + public String getStreet() { + return street; + } + + + public void setStreet(String street) { + this.street = street; + } + + + + @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.country, address.country) && + Objects.equals(this.houseNumberOrName, address.houseNumberOrName) && + Objects.equals(this.postalCode, address.postalCode) && + Objects.equals(this.stateOrProvince, address.stateOrProvince) && + Objects.equals(this.street, address.street); + } + + @Override + public int hashCode() { + return Objects.hash(city, country, houseNumberOrName, postalCode, stateOrProvince, street); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Address {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" houseNumberOrName: ").append(toIndentedString(houseNumberOrName)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).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("country"); + openapiFields.add("houseNumberOrName"); + openapiFields.add("postalCode"); + openapiFields.add("stateOrProvince"); + openapiFields.add("street"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("city"); + openapiRequiredFields.add("country"); + openapiRequiredFields.add("houseNumberOrName"); + openapiRequiredFields.add("postalCode"); + openapiRequiredFields.add("street"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Address.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Address.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 city + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonPrimitive()) { + log.log(Level.WARNING, 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 country + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonPrimitive()) { + log.log(Level.WARNING, 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 houseNumberOrName + if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + } + // validate the optional field postalCode + if (jsonObj.get("postalCode") != null && !jsonObj.get("postalCode").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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 street + if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").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/configurationwebhooks/Amount.java b/src/main/java/com/adyen/model/configurationwebhooks/Amount.java new file mode 100644 index 000000000..45c0b13f7 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Amount.java @@ -0,0 +1,252 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Amount + */ + +public class Amount { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Long value; + + public Amount() { + } + + public Amount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public Amount value(Long value) { + + this.value = value; + return this; + } + + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @return value + **/ + @ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + + public Long getValue() { + return value; + } + + + public void setValue(Long value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) && + Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("value"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Amount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Amount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Amount is not found in the empty JSON string", Amount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Amount.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Amount.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Amount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Amount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Amount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Amount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Amount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws IOException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Authentication.java b/src/main/java/com/adyen/model/configurationwebhooks/Authentication.java new file mode 100644 index 000000000..bbe94332c --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Authentication.java @@ -0,0 +1,281 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Phone; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Authentication + */ + +public class Authentication { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + private String password; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private Phone phone; + + public Authentication() { + } + + public Authentication email(String email) { + + this.email = email; + return this; + } + + /** + * The email address where the one-time password (OTP) is sent. + * @return email + **/ + @ApiModelProperty(value = "The email address where the one-time password (OTP) is sent.") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public Authentication password(String password) { + + this.password = password; + return this; + } + + /** + * The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó** + * @return password + **/ + @ApiModelProperty(value = "The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#'\",;:$&àùòâôûáúó**") + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public Authentication phone(Phone phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @ApiModelProperty(value = "") + + public Phone getPhone() { + return phone; + } + + + public void setPhone(Phone phone) { + this.phone = phone; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Authentication authentication = (Authentication) o; + return Objects.equals(this.email, authentication.email) && + Objects.equals(this.password, authentication.password) && + Objects.equals(this.phone, authentication.phone); + } + + @Override + public int hashCode() { + return Objects.hash(email, password, phone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Authentication {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).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("email"); + openapiFields.add("password"); + openapiFields.add("phone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Authentication.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Authentication + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Authentication.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Authentication is not found in the empty JSON string", Authentication.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Authentication.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Authentication` properties.", entry.getKey())); + } + } + // validate the optional field email + if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the optional field password + if (jsonObj.get("password") != null && !jsonObj.get("password").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + // validate the optional field `phone` + if (jsonObj.getAsJsonObject("phone") != null) { + Phone.validateJsonObject(jsonObj.getAsJsonObject("phone")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Authentication.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Authentication' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Authentication.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Authentication value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Authentication read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Authentication given an JSON string + * + * @param jsonString JSON string + * @return An instance of Authentication + * @throws IOException if the JSON string is invalid with respect to Authentication + */ + public static Authentication fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Authentication.class); + } + + /** + * Convert an instance of Authentication to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Balance.java b/src/main/java/com/adyen/model/configurationwebhooks/Balance.java new file mode 100644 index 000000000..47d250379 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Balance.java @@ -0,0 +1,312 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Balance + */ + +public class Balance { + public static final String SERIALIZED_NAME_AVAILABLE = "available"; + @SerializedName(SERIALIZED_NAME_AVAILABLE) + private Long available; + + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private Long balance; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_RESERVED = "reserved"; + @SerializedName(SERIALIZED_NAME_RESERVED) + private Long reserved; + + public Balance() { + } + + public Balance available(Long available) { + + this.available = available; + return this; + } + + /** + * The remaining amount available for spending. + * @return available + **/ + @ApiModelProperty(required = true, value = "The remaining amount available for spending.") + + public Long getAvailable() { + return available; + } + + + public void setAvailable(Long available) { + this.available = available; + } + + + public Balance balance(Long balance) { + + this.balance = balance; + return this; + } + + /** + * The total amount in the balance. + * @return balance + **/ + @ApiModelProperty(required = true, value = "The total amount in the balance.") + + public Long getBalance() { + return balance; + } + + + public void setBalance(Long balance) { + this.balance = balance; + } + + + public Balance currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance.") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public Balance reserved(Long reserved) { + + this.reserved = reserved; + return this; + } + + /** + * The amount reserved for payments that have been authorised, but have not been captured yet. + * @return reserved + **/ + @ApiModelProperty(required = true, value = "The amount reserved for payments that have been authorised, but have not been captured yet.") + + public Long getReserved() { + return reserved; + } + + + public void setReserved(Long reserved) { + this.reserved = reserved; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Balance balance = (Balance) o; + return Objects.equals(this.available, balance.available) && + Objects.equals(this.balance, balance.balance) && + Objects.equals(this.currency, balance.currency) && + Objects.equals(this.reserved, balance.reserved); + } + + @Override + public int hashCode() { + return Objects.hash(available, balance, currency, reserved); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Balance {\n"); + sb.append(" available: ").append(toIndentedString(available)).append("\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" reserved: ").append(toIndentedString(reserved)).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("available"); + openapiFields.add("balance"); + openapiFields.add("currency"); + openapiFields.add("reserved"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("available"); + openapiRequiredFields.add("balance"); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("reserved"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Balance.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Balance + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Balance.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Balance is not found in the empty JSON string", Balance.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Balance.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Balance` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Balance.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Balance.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Balance' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Balance.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Balance value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Balance read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Balance given an JSON string + * + * @param jsonString JSON string + * @return An instance of Balance + * @throws IOException if the JSON string is invalid with respect to Balance + */ + public static Balance fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Balance.class); + } + + /** + * Convert an instance of Balance to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java new file mode 100644 index 000000000..f30e0a1e9 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccount.java @@ -0,0 +1,617 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Balance; +import com.adyen.model.configurationwebhooks.PaymentInstrumentReference; +import com.adyen.model.configurationwebhooks.SweepConfiguration; +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.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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * BalanceAccount + */ + +public class BalanceAccount { + 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_BALANCES = "balances"; + @SerializedName(SERIALIZED_NAME_BALANCES) + private List balances = null; + + 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_PAYMENT_INSTRUMENTS = "paymentInstruments"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENTS) + private List paymentInstruments = null; + + 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_SWEEP_CONFIGURATIONS = "sweepConfigurations"; + @SerializedName(SERIALIZED_NAME_SWEEP_CONFIGURATIONS) + private Map sweepConfigurations = null; + + public static final String SERIALIZED_NAME_TIME_ZONE = "timeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + private String timeZone; + + public BalanceAccount() { + } + + public BalanceAccount 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 BalanceAccount balances(List balances) { + + this.balances = balances; + return this; + } + + public BalanceAccount addBalancesItem(Balance balancesItem) { + if (this.balances == null) { + this.balances = new ArrayList<>(); + } + this.balances.add(balancesItem); + return this; + } + + /** + * List of balances with the amount and currency. + * @return balances + **/ + @ApiModelProperty(value = "List of balances with the amount and currency.") + + public List getBalances() { + return balances; + } + + + public void setBalances(List balances) { + this.balances = balances; + } + + + public BalanceAccount 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 BalanceAccount 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 BalanceAccount 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 BalanceAccount paymentInstruments(List paymentInstruments) { + + this.paymentInstruments = paymentInstruments; + return this; + } + + public BalanceAccount addPaymentInstrumentsItem(PaymentInstrumentReference paymentInstrumentsItem) { + if (this.paymentInstruments == null) { + this.paymentInstruments = new ArrayList<>(); + } + this.paymentInstruments.add(paymentInstrumentsItem); + return this; + } + + /** + * List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account. + * @return paymentInstruments + **/ + @ApiModelProperty(value = "List of [payment instruments](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/paymentInstruments) associated with the balance account.") + + public List getPaymentInstruments() { + return paymentInstruments; + } + + + public void setPaymentInstruments(List paymentInstruments) { + this.paymentInstruments = paymentInstruments; + } + + + public BalanceAccount 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 BalanceAccount 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 BalanceAccount sweepConfigurations(Map sweepConfigurations) { + + this.sweepConfigurations = sweepConfigurations; + return this; + } + + public BalanceAccount putSweepConfigurationsItem(String key, SweepConfiguration sweepConfigurationsItem) { + if (this.sweepConfigurations == null) { + this.sweepConfigurations = new HashMap<>(); + } + this.sweepConfigurations.put(key, sweepConfigurationsItem); + return this; + } + + /** + * Contains key-value pairs that specify configurations for balance sweeps per currency code. A sweep pulls in or pushes out funds based on a defined schedule, amount, and a source (for pulling funds) or a destination (for pushing funds). The key must be a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The value must be an object containing the sweep configuration. + * @return sweepConfigurations + **/ + @ApiModelProperty(value = "Contains key-value pairs that specify configurations for balance sweeps per currency code. A sweep pulls in or pushes out funds based on a defined schedule, amount, and a source (for pulling funds) or a destination (for pushing funds). The key must be a three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The value must be an object containing the sweep configuration.") + + public Map getSweepConfigurations() { + return sweepConfigurations; + } + + + public void setSweepConfigurations(Map sweepConfigurations) { + this.sweepConfigurations = sweepConfigurations; + } + + + public BalanceAccount timeZone(String timeZone) { + + this.timeZone = timeZone; + return this; + } + + /** + * 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 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; + } + BalanceAccount balanceAccount = (BalanceAccount) o; + return Objects.equals(this.accountHolderId, balanceAccount.accountHolderId) && + Objects.equals(this.balances, balanceAccount.balances) && + Objects.equals(this.defaultCurrencyCode, balanceAccount.defaultCurrencyCode) && + Objects.equals(this.description, balanceAccount.description) && + Objects.equals(this.id, balanceAccount.id) && + Objects.equals(this.paymentInstruments, balanceAccount.paymentInstruments) && + Objects.equals(this.reference, balanceAccount.reference) && + Objects.equals(this.status, balanceAccount.status) && + Objects.equals(this.sweepConfigurations, balanceAccount.sweepConfigurations) && + Objects.equals(this.timeZone, balanceAccount.timeZone); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolderId, balances, defaultCurrencyCode, description, id, paymentInstruments, reference, status, sweepConfigurations, timeZone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceAccount {\n"); + sb.append(" accountHolderId: ").append(toIndentedString(accountHolderId)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).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(" paymentInstruments: ").append(toIndentedString(paymentInstruments)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sweepConfigurations: ").append(toIndentedString(sweepConfigurations)).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("balances"); + openapiFields.add("defaultCurrencyCode"); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("paymentInstruments"); + openapiFields.add("reference"); + openapiFields.add("status"); + openapiFields.add("sweepConfigurations"); + openapiFields.add("timeZone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountHolderId"); + openapiRequiredFields.add("id"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccount.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceAccount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceAccount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceAccount is not found in the empty JSON string", BalanceAccount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceAccount.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccount` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BalanceAccount.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()) { + log.log(Level.WARNING, String.format("Expected the field `accountHolderId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountHolderId").toString())); + } + 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++) { + Balance.validateJsonObject(jsonArraybalances.get(i).getAsJsonObject()); + } + } + // validate the optional field defaultCurrencyCode + if (jsonObj.get("defaultCurrencyCode") != null && !jsonObj.get("defaultCurrencyCode").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + JsonArray jsonArraypaymentInstruments = jsonObj.getAsJsonArray("paymentInstruments"); + if (jsonArraypaymentInstruments != null) { + // ensure the json data is an array + if (!jsonObj.get("paymentInstruments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `paymentInstruments` to be an array in the JSON string but got `%s`", jsonObj.get("paymentInstruments").toString())); + } + + // validate the optional field `paymentInstruments` (array) + for (int i = 0; i < jsonArraypaymentInstruments.size(); i++) { + PaymentInstrumentReference.validateJsonObject(jsonArraypaymentInstruments.get(i).getAsJsonObject()); + } + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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 (!BalanceAccount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceAccount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceAccount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceAccount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceAccount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceAccount given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceAccount + * @throws IOException if the JSON string is invalid with respect to BalanceAccount + */ + public static BalanceAccount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceAccount.class); + } + + /** + * Convert an instance of BalanceAccount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java new file mode 100644 index 000000000..3376e045e --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationData.java @@ -0,0 +1,248 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.BalanceAccount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * BalanceAccountNotificationData + */ + +public class BalanceAccountNotificationData { + public static final String SERIALIZED_NAME_BALANCE_ACCOUNT = "balanceAccount"; + @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT) + private BalanceAccount balanceAccount; + + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public BalanceAccountNotificationData() { + } + + public BalanceAccountNotificationData balanceAccount(BalanceAccount balanceAccount) { + + this.balanceAccount = balanceAccount; + return this; + } + + /** + * Get balanceAccount + * @return balanceAccount + **/ + @ApiModelProperty(value = "") + + public BalanceAccount getBalanceAccount() { + return balanceAccount; + } + + + public void setBalanceAccount(BalanceAccount balanceAccount) { + this.balanceAccount = balanceAccount; + } + + + public BalanceAccountNotificationData balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceAccountNotificationData balanceAccountNotificationData = (BalanceAccountNotificationData) o; + return Objects.equals(this.balanceAccount, balanceAccountNotificationData.balanceAccount) && + Objects.equals(this.balancePlatform, balanceAccountNotificationData.balancePlatform); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccount, balancePlatform); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceAccountNotificationData {\n"); + sb.append(" balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).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("balanceAccount"); + openapiFields.add("balancePlatform"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccountNotificationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceAccountNotificationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceAccountNotificationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceAccountNotificationData is not found in the empty JSON string", BalanceAccountNotificationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceAccountNotificationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountNotificationData` properties.", entry.getKey())); + } + } + // validate the optional field `balanceAccount` + if (jsonObj.getAsJsonObject("balanceAccount") != null) { + BalanceAccount.validateJsonObject(jsonObj.getAsJsonObject("balanceAccount")); + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalanceAccountNotificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceAccountNotificationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceAccountNotificationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceAccountNotificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceAccountNotificationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceAccountNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceAccountNotificationData + * @throws IOException if the JSON string is invalid with respect to BalanceAccountNotificationData + */ + public static BalanceAccountNotificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceAccountNotificationData.class); + } + + /** + * Convert an instance of BalanceAccountNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java new file mode 100644 index 000000000..7ae1ca69c --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalanceAccountNotificationRequest.java @@ -0,0 +1,341 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.BalanceAccountNotificationData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * BalanceAccountNotificationRequest + */ + +public class BalanceAccountNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private BalanceAccountNotificationData data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * Type of notification. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + UPDATED("balancePlatform.balanceAccount.updated"), + + CREATED("balancePlatform.balanceAccount.created"); + + 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 BalanceAccountNotificationRequest() { + } + + public BalanceAccountNotificationRequest data(BalanceAccountNotificationData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public BalanceAccountNotificationData getData() { + return data; + } + + + public void setData(BalanceAccountNotificationData data) { + this.data = data; + } + + + public BalanceAccountNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public BalanceAccountNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of notification. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of notification.") + + 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; + } + BalanceAccountNotificationRequest balanceAccountNotificationRequest = (BalanceAccountNotificationRequest) o; + return Objects.equals(this.data, balanceAccountNotificationRequest.data) && + Objects.equals(this.environment, balanceAccountNotificationRequest.environment) && + Objects.equals(this.type, balanceAccountNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceAccountNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceAccountNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceAccountNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceAccountNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceAccountNotificationRequest is not found in the empty JSON string", BalanceAccountNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceAccountNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceAccountNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BalanceAccountNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + BalanceAccountNotificationData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!BalanceAccountNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceAccountNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceAccountNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceAccountNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceAccountNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceAccountNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceAccountNotificationRequest + * @throws IOException if the JSON string is invalid with respect to BalanceAccountNotificationRequest + */ + public static BalanceAccountNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceAccountNotificationRequest.class); + } + + /** + * Convert an instance of BalanceAccountNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java new file mode 100644 index 000000000..05b36f450 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/BalancePlatformNotificationResponse.java @@ -0,0 +1,214 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * BalancePlatformNotificationResponse + */ + +public class BalancePlatformNotificationResponse { + public static final String SERIALIZED_NAME_NOTIFICATION_RESPONSE = "notificationResponse"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_RESPONSE) + private String notificationResponse; + + public BalancePlatformNotificationResponse() { + } + + public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { + + this.notificationResponse = notificationResponse; + return this; + } + + /** + * Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @return notificationResponse + **/ + @ApiModelProperty(value = "Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).") + + public String getNotificationResponse() { + return notificationResponse; + } + + + public void setNotificationResponse(String notificationResponse) { + this.notificationResponse = notificationResponse; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalancePlatformNotificationResponse balancePlatformNotificationResponse = (BalancePlatformNotificationResponse) o; + return Objects.equals(this.notificationResponse, balancePlatformNotificationResponse.notificationResponse); + } + + @Override + public int hashCode() { + return Objects.hash(notificationResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalancePlatformNotificationResponse {\n"); + sb.append(" notificationResponse: ").append(toIndentedString(notificationResponse)).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("notificationResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalancePlatformNotificationResponse.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalancePlatformNotificationResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalancePlatformNotificationResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalancePlatformNotificationResponse is not found in the empty JSON string", BalancePlatformNotificationResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalancePlatformNotificationResponse.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalancePlatformNotificationResponse` properties.", entry.getKey())); + } + } + // validate the optional field notificationResponse + if (jsonObj.get("notificationResponse") != null && !jsonObj.get("notificationResponse").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `notificationResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationResponse").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalancePlatformNotificationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalancePlatformNotificationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalancePlatformNotificationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalancePlatformNotificationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalancePlatformNotificationResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalancePlatformNotificationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalancePlatformNotificationResponse + * @throws IOException if the JSON string is invalid with respect to BalancePlatformNotificationResponse + */ + public static BalancePlatformNotificationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalancePlatformNotificationResponse.class); + } + + /** + * Convert an instance of BalancePlatformNotificationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java b/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java new file mode 100644 index 000000000..9af1df641 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/BulkAddress.java @@ -0,0 +1,486 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * BulkAddress + */ + +public class BulkAddress { + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_COMPANY = "company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + private String company; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; + @SerializedName(SERIALIZED_NAME_HOUSE_NUMBER_OR_NAME) + private String houseNumberOrName; + + public static final String SERIALIZED_NAME_MOBILE = "mobile"; + @SerializedName(SERIALIZED_NAME_MOBILE) + private String mobile; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + private String postalCode; + + public static final String SERIALIZED_NAME_STATE_OR_PROVINCE = "stateOrProvince"; + @SerializedName(SERIALIZED_NAME_STATE_OR_PROVINCE) + private String stateOrProvince; + + public static final String SERIALIZED_NAME_STREET = "street"; + @SerializedName(SERIALIZED_NAME_STREET) + private String street; + + public BulkAddress() { + } + + public BulkAddress city(String city) { + + this.city = city; + return this; + } + + /** + * The name of the city. + * @return city + **/ + @ApiModelProperty(value = "The name of the city.") + + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + public BulkAddress company(String company) { + + this.company = company; + return this; + } + + /** + * The name of the company. + * @return company + **/ + @ApiModelProperty(value = "The name of the company.") + + public String getCompany() { + return company; + } + + + public void setCompany(String company) { + this.company = company; + } + + + public BulkAddress country(String country) { + + this.country = country; + return this; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + * @return country + **/ + @ApiModelProperty(required = true, value = "The two-character ISO-3166-1 alpha-2 country code. For example, **US**.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public BulkAddress email(String email) { + + this.email = email; + return this; + } + + /** + * The email address. + * @return email + **/ + @ApiModelProperty(value = "The email address.") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public BulkAddress houseNumberOrName(String houseNumberOrName) { + + this.houseNumberOrName = houseNumberOrName; + return this; + } + + /** + * The house number or name. + * @return houseNumberOrName + **/ + @ApiModelProperty(value = "The house number or name.") + + public String getHouseNumberOrName() { + return houseNumberOrName; + } + + + public void setHouseNumberOrName(String houseNumberOrName) { + this.houseNumberOrName = houseNumberOrName; + } + + + public BulkAddress mobile(String mobile) { + + this.mobile = mobile; + return this; + } + + /** + * The full telephone number. + * @return mobile + **/ + @ApiModelProperty(value = "The full telephone number.") + + public String getMobile() { + return mobile; + } + + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + + public BulkAddress postalCode(String postalCode) { + + this.postalCode = postalCode; + return this; + } + + /** + * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries. + * @return postalCode + **/ + @ApiModelProperty(value = "The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries.") + + public String getPostalCode() { + return postalCode; + } + + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + + public BulkAddress stateOrProvince(String stateOrProvince) { + + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US. + * @return stateOrProvince + **/ + @ApiModelProperty(value = "The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US.") + + public String getStateOrProvince() { + return stateOrProvince; + } + + + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + + public BulkAddress street(String street) { + + this.street = street; + return this; + } + + /** + * The streetname of the house. + * @return street + **/ + @ApiModelProperty(value = "The streetname of the house.") + + public String getStreet() { + return street; + } + + + public void setStreet(String street) { + this.street = street; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkAddress bulkAddress = (BulkAddress) o; + return Objects.equals(this.city, bulkAddress.city) && + Objects.equals(this.company, bulkAddress.company) && + Objects.equals(this.country, bulkAddress.country) && + Objects.equals(this.email, bulkAddress.email) && + Objects.equals(this.houseNumberOrName, bulkAddress.houseNumberOrName) && + Objects.equals(this.mobile, bulkAddress.mobile) && + Objects.equals(this.postalCode, bulkAddress.postalCode) && + Objects.equals(this.stateOrProvince, bulkAddress.stateOrProvince) && + Objects.equals(this.street, bulkAddress.street); + } + + @Override + public int hashCode() { + return Objects.hash(city, company, country, email, houseNumberOrName, mobile, postalCode, stateOrProvince, street); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkAddress {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" houseNumberOrName: ").append(toIndentedString(houseNumberOrName)).append("\n"); + sb.append(" mobile: ").append(toIndentedString(mobile)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).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("company"); + openapiFields.add("country"); + openapiFields.add("email"); + openapiFields.add("houseNumberOrName"); + openapiFields.add("mobile"); + openapiFields.add("postalCode"); + openapiFields.add("stateOrProvince"); + openapiFields.add("street"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("country"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BulkAddress.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BulkAddress + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BulkAddress.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BulkAddress is not found in the empty JSON string", BulkAddress.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BulkAddress.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BulkAddress` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkAddress.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 city + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonPrimitive()) { + log.log(Level.WARNING, 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 company + if (jsonObj.get("company") != null && !jsonObj.get("company").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("company").toString())); + } + // validate the optional field country + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonPrimitive()) { + log.log(Level.WARNING, 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 email + if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the optional field houseNumberOrName + if (jsonObj.get("houseNumberOrName") != null && !jsonObj.get("houseNumberOrName").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `houseNumberOrName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("houseNumberOrName").toString())); + } + // validate the optional field mobile + if (jsonObj.get("mobile") != null && !jsonObj.get("mobile").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `mobile` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mobile").toString())); + } + // validate the optional field postalCode + if (jsonObj.get("postalCode") != null && !jsonObj.get("postalCode").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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 street + if (jsonObj.get("street") != null && !jsonObj.get("street").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `street` to be a primitive type in the JSON string but got `%s`", jsonObj.get("street").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BulkAddress.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkAddress' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkAddress.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BulkAddress value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BulkAddress read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkAddress given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkAddress + * @throws IOException if the JSON string is invalid with respect to BulkAddress + */ + public static BulkAddress fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkAddress.class); + } + + /** + * Convert an instance of BulkAddress to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Card.java b/src/main/java/com/adyen/model/configurationwebhooks/Card.java new file mode 100644 index 000000000..867e5d8e8 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Card.java @@ -0,0 +1,645 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Authentication; +import com.adyen.model.configurationwebhooks.CardConfiguration; +import com.adyen.model.configurationwebhooks.Contact; +import com.adyen.model.configurationwebhooks.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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Card + */ + +public class Card { + public static final String SERIALIZED_NAME_AUTHENTICATION = "authentication"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATION) + private Authentication authentication; + + public static final String SERIALIZED_NAME_BIN = "bin"; + @SerializedName(SERIALIZED_NAME_BIN) + private String bin; + + public static final String SERIALIZED_NAME_BRAND = "brand"; + @SerializedName(SERIALIZED_NAME_BRAND) + private String brand; + + public static final String SERIALIZED_NAME_BRAND_VARIANT = "brandVariant"; + @SerializedName(SERIALIZED_NAME_BRAND_VARIANT) + private String brandVariant; + + public static final String SERIALIZED_NAME_CARDHOLDER_NAME = "cardholderName"; + @SerializedName(SERIALIZED_NAME_CARDHOLDER_NAME) + private String cardholderName; + + public static final String SERIALIZED_NAME_CONFIGURATION = "configuration"; + @SerializedName(SERIALIZED_NAME_CONFIGURATION) + private CardConfiguration configuration; + + public static final String SERIALIZED_NAME_CVC = "cvc"; + @SerializedName(SERIALIZED_NAME_CVC) + private String cvc; + + public static final String SERIALIZED_NAME_DELIVERY_CONTACT = "deliveryContact"; + @SerializedName(SERIALIZED_NAME_DELIVERY_CONTACT) + private Contact deliveryContact; + + public static final String SERIALIZED_NAME_EXPIRATION = "expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + private Expiry expiration; + + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + */ + @JsonAdapter(FormFactorEnum.Adapter.class) + public enum FormFactorEnum { + PHYSICAL("physical"), + + UNKNOWN("unknown"), + + VIRTUAL("virtual"); + + private String value; + + FormFactorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static FormFactorEnum fromValue(String value) { + for (FormFactorEnum b : FormFactorEnum.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 FormFactorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public FormFactorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return FormFactorEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_FORM_FACTOR = "formFactor"; + @SerializedName(SERIALIZED_NAME_FORM_FACTOR) + private FormFactorEnum formFactor; + + public static final String SERIALIZED_NAME_LAST_FOUR = "lastFour"; + @SerializedName(SERIALIZED_NAME_LAST_FOUR) + private String lastFour; + + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + public Card() { + } + + public Card authentication(Authentication authentication) { + + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * @return authentication + **/ + @ApiModelProperty(value = "") + + public Authentication getAuthentication() { + return authentication; + } + + + public void setAuthentication(Authentication authentication) { + this.authentication = authentication; + } + + + public Card bin(String bin) { + + this.bin = bin; + return this; + } + + /** + * The bank identification number (BIN) of the card number. + * @return bin + **/ + @ApiModelProperty(value = "The bank identification number (BIN) of the card number.") + + public String getBin() { + return bin; + } + + + public void setBin(String bin) { + this.bin = bin; + } + + + public Card brand(String brand) { + + this.brand = brand; + return this; + } + + /** + * The brand of the physical or the virtual card. Possible values: **visa**, **mc**. + * @return brand + **/ + @ApiModelProperty(required = true, value = "The brand of the physical or the virtual card. Possible values: **visa**, **mc**.") + + public String getBrand() { + return brand; + } + + + public void setBrand(String brand) { + this.brand = brand; + } + + + public Card brandVariant(String brandVariant) { + + this.brandVariant = brandVariant; + return this; + } + + /** + * 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 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; + } + + + public void setBrandVariant(String brandVariant) { + this.brandVariant = brandVariant; + } + + + public Card cardholderName(String cardholderName) { + + this.cardholderName = cardholderName; + return this; + } + + /** + * The name of the cardholder. Maximum length: 26 characters. + * @return cardholderName + **/ + @ApiModelProperty(required = true, value = "The name of the cardholder. Maximum length: 26 characters.") + + public String getCardholderName() { + return cardholderName; + } + + + public void setCardholderName(String cardholderName) { + this.cardholderName = cardholderName; + } + + + public Card configuration(CardConfiguration configuration) { + + this.configuration = configuration; + return this; + } + + /** + * Get configuration + * @return configuration + **/ + @ApiModelProperty(value = "") + + public CardConfiguration getConfiguration() { + return configuration; + } + + + public void setConfiguration(CardConfiguration configuration) { + this.configuration = configuration; + } + + + public Card cvc(String cvc) { + + this.cvc = cvc; + return this; + } + + /** + * The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. + * @return cvc + **/ + @ApiModelProperty(value = "The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards.") + + public String getCvc() { + return cvc; + } + + + public void setCvc(String cvc) { + this.cvc = cvc; + } + + + public Card deliveryContact(Contact deliveryContact) { + + this.deliveryContact = deliveryContact; + return this; + } + + /** + * Get deliveryContact + * @return deliveryContact + **/ + @ApiModelProperty(value = "") + + public Contact getDeliveryContact() { + return deliveryContact; + } + + + public void setDeliveryContact(Contact deliveryContact) { + this.deliveryContact = deliveryContact; + } + + + public Card expiration(Expiry expiration) { + + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + **/ + @ApiModelProperty(value = "") + + public Expiry getExpiration() { + return expiration; + } + + + public void setExpiration(Expiry expiration) { + this.expiration = expiration; + } + + + public Card formFactor(FormFactorEnum formFactor) { + + this.formFactor = formFactor; + return this; + } + + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + * @return formFactor + **/ + @ApiModelProperty(required = true, value = "The form factor of the card. Possible values: **virtual**, **physical**.") + + public FormFactorEnum getFormFactor() { + return formFactor; + } + + + public void setFormFactor(FormFactorEnum formFactor) { + this.formFactor = formFactor; + } + + + public Card lastFour(String lastFour) { + + this.lastFour = lastFour; + return this; + } + + /** + * Last last four digits of the card number. + * @return lastFour + **/ + @ApiModelProperty(value = "Last last four digits of the card number.") + + public String getLastFour() { + return lastFour; + } + + + public void setLastFour(String lastFour) { + this.lastFour = lastFour; + } + + + public Card number(String number) { + + this.number = number; + return this; + } + + /** + * The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + * @return number + **/ + @ApiModelProperty(required = true, value = "The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Card card = (Card) o; + return Objects.equals(this.authentication, card.authentication) && + Objects.equals(this.bin, card.bin) && + Objects.equals(this.brand, card.brand) && + Objects.equals(this.brandVariant, card.brandVariant) && + Objects.equals(this.cardholderName, card.cardholderName) && + Objects.equals(this.configuration, card.configuration) && + Objects.equals(this.cvc, card.cvc) && + Objects.equals(this.deliveryContact, card.deliveryContact) && + Objects.equals(this.expiration, card.expiration) && + Objects.equals(this.formFactor, card.formFactor) && + Objects.equals(this.lastFour, card.lastFour) && + Objects.equals(this.number, card.number); + } + + @Override + public int hashCode() { + return Objects.hash(authentication, bin, brand, brandVariant, cardholderName, configuration, cvc, deliveryContact, expiration, formFactor, lastFour, number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Card {\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" bin: ").append(toIndentedString(bin)).append("\n"); + sb.append(" brand: ").append(toIndentedString(brand)).append("\n"); + sb.append(" brandVariant: ").append(toIndentedString(brandVariant)).append("\n"); + sb.append(" cardholderName: ").append(toIndentedString(cardholderName)).append("\n"); + sb.append(" configuration: ").append(toIndentedString(configuration)).append("\n"); + sb.append(" cvc: ").append(toIndentedString(cvc)).append("\n"); + sb.append(" deliveryContact: ").append(toIndentedString(deliveryContact)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" formFactor: ").append(toIndentedString(formFactor)).append("\n"); + sb.append(" lastFour: ").append(toIndentedString(lastFour)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append("}"); + 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("authentication"); + openapiFields.add("bin"); + openapiFields.add("brand"); + openapiFields.add("brandVariant"); + openapiFields.add("cardholderName"); + openapiFields.add("configuration"); + openapiFields.add("cvc"); + openapiFields.add("deliveryContact"); + openapiFields.add("expiration"); + openapiFields.add("formFactor"); + openapiFields.add("lastFour"); + openapiFields.add("number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("brand"); + openapiRequiredFields.add("brandVariant"); + openapiRequiredFields.add("cardholderName"); + openapiRequiredFields.add("formFactor"); + openapiRequiredFields.add("number"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Card.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Card + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Card.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Card is not found in the empty JSON string", Card.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Card.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Card` properties.", entry.getKey())); + } + } + + // 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 `authentication` + if (jsonObj.getAsJsonObject("authentication") != null) { + Authentication.validateJsonObject(jsonObj.getAsJsonObject("authentication")); + } + // validate the optional field bin + if (jsonObj.get("bin") != null && !jsonObj.get("bin").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `bin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("bin").toString())); + } + // validate the optional field brand + if (jsonObj.get("brand") != null && !jsonObj.get("brand").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `brand` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brand").toString())); + } + // validate the optional field brandVariant + if (jsonObj.get("brandVariant") != null && !jsonObj.get("brandVariant").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `brandVariant` to be a primitive type in the JSON string but got `%s`", jsonObj.get("brandVariant").toString())); + } + // validate the optional field cardholderName + if (jsonObj.get("cardholderName") != null && !jsonObj.get("cardholderName").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `cardholderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardholderName").toString())); + } + // validate the optional field `configuration` + if (jsonObj.getAsJsonObject("configuration") != null) { + CardConfiguration.validateJsonObject(jsonObj.getAsJsonObject("configuration")); + } + // validate the optional field cvc + if (jsonObj.get("cvc") != null && !jsonObj.get("cvc").isJsonPrimitive()) { + log.log(Level.WARNING, 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 `deliveryContact` + if (jsonObj.getAsJsonObject("deliveryContact") != null) { + Contact.validateJsonObject(jsonObj.getAsJsonObject("deliveryContact")); + } + // validate the optional field `expiration` + if (jsonObj.getAsJsonObject("expiration") != null) { + Expiry.validateJsonObject(jsonObj.getAsJsonObject("expiration")); + } + // ensure the field formFactor can be parsed to an enum value + if (jsonObj.get("formFactor") != null) { + if(!jsonObj.get("formFactor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `formFactor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("formFactor").toString())); + } + FormFactorEnum.fromValue(jsonObj.get("formFactor").getAsString()); + } + // validate the optional field lastFour + if (jsonObj.get("lastFour") != null && !jsonObj.get("lastFour").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `lastFour` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastFour").toString())); + } + // validate the optional field number + if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Card.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Card' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Card.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Card value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Card read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Card given an JSON string + * + * @param jsonString JSON string + * @return An instance of Card + * @throws IOException if the JSON string is invalid with respect to Card + */ + public static Card fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Card.class); + } + + /** + * Convert an instance of Card to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java b/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java new file mode 100644 index 000000000..876f17b3e --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardConfiguration.java @@ -0,0 +1,652 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.BulkAddress; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * CardConfiguration + */ + +public class CardConfiguration { + public static final String SERIALIZED_NAME_ACTIVATION = "activation"; + @SerializedName(SERIALIZED_NAME_ACTIVATION) + private String activation; + + public static final String SERIALIZED_NAME_ACTIVATION_URL = "activationUrl"; + @SerializedName(SERIALIZED_NAME_ACTIVATION_URL) + private String activationUrl; + + public static final String SERIALIZED_NAME_BULK_ADDRESS = "bulkAddress"; + @SerializedName(SERIALIZED_NAME_BULK_ADDRESS) + private BulkAddress bulkAddress; + + public static final String SERIALIZED_NAME_CARD_IMAGE_ID = "cardImageId"; + @SerializedName(SERIALIZED_NAME_CARD_IMAGE_ID) + private String cardImageId; + + public static final String SERIALIZED_NAME_CARRIER = "carrier"; + @SerializedName(SERIALIZED_NAME_CARRIER) + private String carrier; + + public static final String SERIALIZED_NAME_CARRIER_IMAGE_ID = "carrierImageId"; + @SerializedName(SERIALIZED_NAME_CARRIER_IMAGE_ID) + private String carrierImageId; + + public static final String SERIALIZED_NAME_CONFIGURATION_PROFILE_ID = "configurationProfileId"; + @SerializedName(SERIALIZED_NAME_CONFIGURATION_PROFILE_ID) + private String configurationProfileId; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_ENVELOPE = "envelope"; + @SerializedName(SERIALIZED_NAME_ENVELOPE) + private String envelope; + + public static final String SERIALIZED_NAME_INSERT = "insert"; + @SerializedName(SERIALIZED_NAME_INSERT) + private String insert; + + public static final String SERIALIZED_NAME_LANGUAGE = "language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + private String language; + + public static final String SERIALIZED_NAME_LOGO_IMAGE_ID = "logoImageId"; + @SerializedName(SERIALIZED_NAME_LOGO_IMAGE_ID) + private String logoImageId; + + public static final String SERIALIZED_NAME_PIN_MAILER = "pinMailer"; + @SerializedName(SERIALIZED_NAME_PIN_MAILER) + private String pinMailer; + + public static final String SERIALIZED_NAME_SHIPMENT_METHOD = "shipmentMethod"; + @SerializedName(SERIALIZED_NAME_SHIPMENT_METHOD) + private String shipmentMethod; + + public CardConfiguration() { + } + + public CardConfiguration activation(String activation) { + + this.activation = activation; + return this; + } + + /** + * Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. + * @return activation + **/ + @ApiModelProperty(value = "Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions.") + + public String getActivation() { + return activation; + } + + + public void setActivation(String activation) { + this.activation = activation; + } + + + public CardConfiguration activationUrl(String activationUrl) { + + this.activationUrl = activationUrl; + return this; + } + + /** + * Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. + * @return activationUrl + **/ + @ApiModelProperty(value = "Your app's URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters.") + + public String getActivationUrl() { + return activationUrl; + } + + + public void setActivationUrl(String activationUrl) { + this.activationUrl = activationUrl; + } + + + public CardConfiguration bulkAddress(BulkAddress bulkAddress) { + + this.bulkAddress = bulkAddress; + return this; + } + + /** + * Get bulkAddress + * @return bulkAddress + **/ + @ApiModelProperty(value = "") + + public BulkAddress getBulkAddress() { + return bulkAddress; + } + + + public void setBulkAddress(BulkAddress bulkAddress) { + this.bulkAddress = bulkAddress; + } + + + public CardConfiguration cardImageId(String cardImageId) { + + this.cardImageId = cardImageId; + return this; + } + + /** + * The ID of the card image. This is the image that will be printed on the full front of the card. + * @return cardImageId + **/ + @ApiModelProperty(value = "The ID of the card image. This is the image that will be printed on the full front of the card.") + + public String getCardImageId() { + return cardImageId; + } + + + public void setCardImageId(String cardImageId) { + this.cardImageId = cardImageId; + } + + + public CardConfiguration carrier(String carrier) { + + this.carrier = carrier; + return this; + } + + /** + * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. + * @return carrier + **/ + @ApiModelProperty(value = "Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached.") + + public String getCarrier() { + return carrier; + } + + + public void setCarrier(String carrier) { + this.carrier = carrier; + } + + + public CardConfiguration carrierImageId(String carrierImageId) { + + this.carrierImageId = carrierImageId; + return this; + } + + /** + * The ID of the carrier image. This is the image that will printed on the letter to which the card is attached. + * @return carrierImageId + **/ + @ApiModelProperty(value = "The ID of the carrier image. This is the image that will printed on the letter to which the card is attached.") + + public String getCarrierImageId() { + return carrierImageId; + } + + + public void setCarrierImageId(String carrierImageId) { + this.carrierImageId = carrierImageId; + } + + + public CardConfiguration configurationProfileId(String configurationProfileId) { + + this.configurationProfileId = configurationProfileId; + return this; + } + + /** + * The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + * @return configurationProfileId + **/ + @ApiModelProperty(required = true, value = "The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile.") + + public String getConfigurationProfileId() { + return configurationProfileId; + } + + + public void setConfigurationProfileId(String configurationProfileId) { + this.configurationProfileId = configurationProfileId; + } + + + public CardConfiguration currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. + * @return currency + **/ + @ApiModelProperty(value = "The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**.") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public CardConfiguration envelope(String envelope) { + + this.envelope = envelope; + return this; + } + + /** + * Overrides the envelope design ID defined in the `configurationProfileId`. + * @return envelope + **/ + @ApiModelProperty(value = "Overrides the envelope design ID defined in the `configurationProfileId`. ") + + public String getEnvelope() { + return envelope; + } + + + public void setEnvelope(String envelope) { + this.envelope = envelope; + } + + + public CardConfiguration insert(String insert) { + + this.insert = insert; + return this; + } + + /** + * Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. + * @return insert + **/ + @ApiModelProperty(value = "Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card.") + + public String getInsert() { + return insert; + } + + + public void setInsert(String insert) { + this.insert = insert; + } + + + public CardConfiguration 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 of the card. 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 of the card. For example, **en**.") + + public String getLanguage() { + return language; + } + + + public void setLanguage(String language) { + this.language = language; + } + + + public CardConfiguration logoImageId(String logoImageId) { + + this.logoImageId = logoImageId; + return this; + } + + /** + * The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner. + * @return logoImageId + **/ + @ApiModelProperty(value = "The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner.") + + public String getLogoImageId() { + return logoImageId; + } + + + public void setLogoImageId(String logoImageId) { + this.logoImageId = logoImageId; + } + + + public CardConfiguration pinMailer(String pinMailer) { + + this.pinMailer = pinMailer; + return this; + } + + /** + * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed. + * @return pinMailer + **/ + @ApiModelProperty(value = "Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed.") + + public String getPinMailer() { + return pinMailer; + } + + + public void setPinMailer(String pinMailer) { + this.pinMailer = pinMailer; + } + + + public CardConfiguration shipmentMethod(String shipmentMethod) { + + this.shipmentMethod = shipmentMethod; + return this; + } + + /** + * Overrides the logistics company defined in the `configurationProfileId`. + * @return shipmentMethod + **/ + @ApiModelProperty(value = "Overrides the logistics company defined in the `configurationProfileId`.") + + public String getShipmentMethod() { + return shipmentMethod; + } + + + public void setShipmentMethod(String shipmentMethod) { + this.shipmentMethod = shipmentMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardConfiguration cardConfiguration = (CardConfiguration) o; + return Objects.equals(this.activation, cardConfiguration.activation) && + Objects.equals(this.activationUrl, cardConfiguration.activationUrl) && + Objects.equals(this.bulkAddress, cardConfiguration.bulkAddress) && + Objects.equals(this.cardImageId, cardConfiguration.cardImageId) && + Objects.equals(this.carrier, cardConfiguration.carrier) && + Objects.equals(this.carrierImageId, cardConfiguration.carrierImageId) && + Objects.equals(this.configurationProfileId, cardConfiguration.configurationProfileId) && + Objects.equals(this.currency, cardConfiguration.currency) && + Objects.equals(this.envelope, cardConfiguration.envelope) && + Objects.equals(this.insert, cardConfiguration.insert) && + Objects.equals(this.language, cardConfiguration.language) && + Objects.equals(this.logoImageId, cardConfiguration.logoImageId) && + Objects.equals(this.pinMailer, cardConfiguration.pinMailer) && + Objects.equals(this.shipmentMethod, cardConfiguration.shipmentMethod); + } + + @Override + public int hashCode() { + return Objects.hash(activation, activationUrl, bulkAddress, cardImageId, carrier, carrierImageId, configurationProfileId, currency, envelope, insert, language, logoImageId, pinMailer, shipmentMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardConfiguration {\n"); + sb.append(" activation: ").append(toIndentedString(activation)).append("\n"); + sb.append(" activationUrl: ").append(toIndentedString(activationUrl)).append("\n"); + sb.append(" bulkAddress: ").append(toIndentedString(bulkAddress)).append("\n"); + sb.append(" cardImageId: ").append(toIndentedString(cardImageId)).append("\n"); + sb.append(" carrier: ").append(toIndentedString(carrier)).append("\n"); + sb.append(" carrierImageId: ").append(toIndentedString(carrierImageId)).append("\n"); + sb.append(" configurationProfileId: ").append(toIndentedString(configurationProfileId)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" envelope: ").append(toIndentedString(envelope)).append("\n"); + sb.append(" insert: ").append(toIndentedString(insert)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" logoImageId: ").append(toIndentedString(logoImageId)).append("\n"); + sb.append(" pinMailer: ").append(toIndentedString(pinMailer)).append("\n"); + sb.append(" shipmentMethod: ").append(toIndentedString(shipmentMethod)).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("activation"); + openapiFields.add("activationUrl"); + openapiFields.add("bulkAddress"); + openapiFields.add("cardImageId"); + openapiFields.add("carrier"); + openapiFields.add("carrierImageId"); + openapiFields.add("configurationProfileId"); + openapiFields.add("currency"); + openapiFields.add("envelope"); + openapiFields.add("insert"); + openapiFields.add("language"); + openapiFields.add("logoImageId"); + openapiFields.add("pinMailer"); + openapiFields.add("shipmentMethod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("configurationProfileId"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardConfiguration.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CardConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CardConfiguration.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CardConfiguration is not found in the empty JSON string", CardConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CardConfiguration.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardConfiguration` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CardConfiguration.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 activation + if (jsonObj.get("activation") != null && !jsonObj.get("activation").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `activation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activation").toString())); + } + // validate the optional field activationUrl + if (jsonObj.get("activationUrl") != null && !jsonObj.get("activationUrl").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `activationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("activationUrl").toString())); + } + // validate the optional field `bulkAddress` + if (jsonObj.getAsJsonObject("bulkAddress") != null) { + BulkAddress.validateJsonObject(jsonObj.getAsJsonObject("bulkAddress")); + } + // validate the optional field cardImageId + if (jsonObj.get("cardImageId") != null && !jsonObj.get("cardImageId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `cardImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardImageId").toString())); + } + // validate the optional field carrier + if (jsonObj.get("carrier") != null && !jsonObj.get("carrier").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `carrier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrier").toString())); + } + // validate the optional field carrierImageId + if (jsonObj.get("carrierImageId") != null && !jsonObj.get("carrierImageId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `carrierImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("carrierImageId").toString())); + } + // validate the optional field configurationProfileId + if (jsonObj.get("configurationProfileId") != null && !jsonObj.get("configurationProfileId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `configurationProfileId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("configurationProfileId").toString())); + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + // validate the optional field envelope + if (jsonObj.get("envelope") != null && !jsonObj.get("envelope").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `envelope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("envelope").toString())); + } + // validate the optional field insert + if (jsonObj.get("insert") != null && !jsonObj.get("insert").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `insert` to be a primitive type in the JSON string but got `%s`", jsonObj.get("insert").toString())); + } + // validate the optional field language + if (jsonObj.get("language") != null && !jsonObj.get("language").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("language").toString())); + } + // validate the optional field logoImageId + if (jsonObj.get("logoImageId") != null && !jsonObj.get("logoImageId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `logoImageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logoImageId").toString())); + } + // validate the optional field pinMailer + if (jsonObj.get("pinMailer") != null && !jsonObj.get("pinMailer").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `pinMailer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pinMailer").toString())); + } + // validate the optional field shipmentMethod + if (jsonObj.get("shipmentMethod") != null && !jsonObj.get("shipmentMethod").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `shipmentMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shipmentMethod").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CardConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CardConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CardConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CardConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CardConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CardConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardConfiguration + * @throws IOException if the JSON string is invalid with respect to CardConfiguration + */ + public static CardConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CardConfiguration.class); + } + + /** + * Convert an instance of CardConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java new file mode 100644 index 000000000..7604f91ee --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItem.java @@ -0,0 +1,443 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.CardOrderItemDeliveryStatus; +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * CardOrderItem + */ + +public class CardOrderItem { + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_CARD = "card"; + @SerializedName(SERIALIZED_NAME_CARD) + private CardOrderItemDeliveryStatus card; + + public static final String SERIALIZED_NAME_CARD_ORDER_ITEM_REFERENCE = "cardOrderItemReference"; + @SerializedName(SERIALIZED_NAME_CARD_ORDER_ITEM_REFERENCE) + private String cardOrderItemReference; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private OffsetDateTime creationDate; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_PAYMENT_INSTRUMENT_REFERENCE = "paymentInstrumentReference"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT_REFERENCE) + private String paymentInstrumentReference; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + private CardOrderItemDeliveryStatus pin; + + public static final String SERIALIZED_NAME_SHIPPING_METHOD = "shippingMethod"; + @SerializedName(SERIALIZED_NAME_SHIPPING_METHOD) + private String shippingMethod; + + public CardOrderItem() { + } + + public CardOrderItem balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public CardOrderItem card(CardOrderItemDeliveryStatus card) { + + this.card = card; + return this; + } + + /** + * Get card + * @return card + **/ + @ApiModelProperty(value = "") + + public CardOrderItemDeliveryStatus getCard() { + return card; + } + + + public void setCard(CardOrderItemDeliveryStatus card) { + this.card = card; + } + + + public CardOrderItem cardOrderItemReference(String cardOrderItemReference) { + + this.cardOrderItemReference = cardOrderItemReference; + return this; + } + + /** + * The unique identifier of the card order. + * @return cardOrderItemReference + **/ + @ApiModelProperty(value = "The unique identifier of the card order.") + + public String getCardOrderItemReference() { + return cardOrderItemReference; + } + + + public void setCardOrderItemReference(String cardOrderItemReference) { + this.cardOrderItemReference = cardOrderItemReference; + } + + + public CardOrderItem creationDate(OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.") + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public CardOrderItem id(String id) { + + this.id = id; + return this; + } + + /** + * The ID of the resource. + * @return id + **/ + @ApiModelProperty(value = "The ID of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public CardOrderItem paymentInstrumentReference(String paymentInstrumentReference) { + + this.paymentInstrumentReference = paymentInstrumentReference; + return this; + } + + /** + * The unique identifier of the payment instrument related to the card order. + * @return paymentInstrumentReference + **/ + @ApiModelProperty(value = "The unique identifier of the payment instrument related to the card order.") + + public String getPaymentInstrumentReference() { + return paymentInstrumentReference; + } + + + public void setPaymentInstrumentReference(String paymentInstrumentReference) { + this.paymentInstrumentReference = paymentInstrumentReference; + } + + + public CardOrderItem pin(CardOrderItemDeliveryStatus pin) { + + this.pin = pin; + return this; + } + + /** + * Get pin + * @return pin + **/ + @ApiModelProperty(value = "") + + public CardOrderItemDeliveryStatus getPin() { + return pin; + } + + + public void setPin(CardOrderItemDeliveryStatus pin) { + this.pin = pin; + } + + + public CardOrderItem shippingMethod(String shippingMethod) { + + this.shippingMethod = shippingMethod; + return this; + } + + /** + * Shipping method used to deliver the card or the PIN. + * @return shippingMethod + **/ + @ApiModelProperty(value = "Shipping method used to deliver the card or the PIN.") + + public String getShippingMethod() { + return shippingMethod; + } + + + public void setShippingMethod(String shippingMethod) { + this.shippingMethod = shippingMethod; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardOrderItem cardOrderItem = (CardOrderItem) o; + return Objects.equals(this.balancePlatform, cardOrderItem.balancePlatform) && + Objects.equals(this.card, cardOrderItem.card) && + Objects.equals(this.cardOrderItemReference, cardOrderItem.cardOrderItemReference) && + Objects.equals(this.creationDate, cardOrderItem.creationDate) && + Objects.equals(this.id, cardOrderItem.id) && + Objects.equals(this.paymentInstrumentReference, cardOrderItem.paymentInstrumentReference) && + Objects.equals(this.pin, cardOrderItem.pin) && + Objects.equals(this.shippingMethod, cardOrderItem.shippingMethod); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, card, cardOrderItemReference, creationDate, id, paymentInstrumentReference, pin, shippingMethod); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardOrderItem {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" card: ").append(toIndentedString(card)).append("\n"); + sb.append(" cardOrderItemReference: ").append(toIndentedString(cardOrderItemReference)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" paymentInstrumentReference: ").append(toIndentedString(paymentInstrumentReference)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" shippingMethod: ").append(toIndentedString(shippingMethod)).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("balancePlatform"); + openapiFields.add("card"); + openapiFields.add("cardOrderItemReference"); + openapiFields.add("creationDate"); + openapiFields.add("id"); + openapiFields.add("paymentInstrumentReference"); + openapiFields.add("pin"); + openapiFields.add("shippingMethod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardOrderItem.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CardOrderItem + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CardOrderItem.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CardOrderItem is not found in the empty JSON string", CardOrderItem.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CardOrderItem.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardOrderItem` properties.", entry.getKey())); + } + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field `card` + if (jsonObj.getAsJsonObject("card") != null) { + CardOrderItemDeliveryStatus.validateJsonObject(jsonObj.getAsJsonObject("card")); + } + // validate the optional field cardOrderItemReference + if (jsonObj.get("cardOrderItemReference") != null && !jsonObj.get("cardOrderItemReference").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `cardOrderItemReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cardOrderItemReference").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field paymentInstrumentReference + if (jsonObj.get("paymentInstrumentReference") != null && !jsonObj.get("paymentInstrumentReference").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `paymentInstrumentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentReference").toString())); + } + // validate the optional field `pin` + if (jsonObj.getAsJsonObject("pin") != null) { + CardOrderItemDeliveryStatus.validateJsonObject(jsonObj.getAsJsonObject("pin")); + } + // validate the optional field shippingMethod + if (jsonObj.get("shippingMethod") != null && !jsonObj.get("shippingMethod").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `shippingMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("shippingMethod").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CardOrderItem.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CardOrderItem' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CardOrderItem.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CardOrderItem value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CardOrderItem read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CardOrderItem given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardOrderItem + * @throws IOException if the JSON string is invalid with respect to CardOrderItem + */ + public static CardOrderItem fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CardOrderItem.class); + } + + /** + * Convert an instance of CardOrderItem to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java new file mode 100644 index 000000000..2975f0e88 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderItemDeliveryStatus.java @@ -0,0 +1,373 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * CardOrderItemDeliveryStatus + */ + +public class CardOrderItemDeliveryStatus { + /** + * Status of the delivery. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + CREATED("created"), + + DELIVERED("delivered"), + + PROCESSING("processing"), + + PRODUCED("produced"), + + REJECTED("rejected"), + + SHIPPED("shipped"), + + UNKNOWN("unknown"); + + 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_ERROR = "statusError"; + @SerializedName(SERIALIZED_NAME_STATUS_ERROR) + private String statusError; + + public static final String SERIALIZED_NAME_STATUS_ERROR_MESSAGE = "statusErrorMessage"; + @SerializedName(SERIALIZED_NAME_STATUS_ERROR_MESSAGE) + private String statusErrorMessage; + + public static final String SERIALIZED_NAME_TRACKING_NUMBER = "trackingNumber"; + @SerializedName(SERIALIZED_NAME_TRACKING_NUMBER) + private String trackingNumber; + + public CardOrderItemDeliveryStatus() { + } + + public CardOrderItemDeliveryStatus status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * Status of the delivery. + * @return status + **/ + @ApiModelProperty(value = "Status of the delivery.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public CardOrderItemDeliveryStatus statusError(String statusError) { + + this.statusError = statusError; + return this; + } + + /** + * Error status, if any. + * @return statusError + **/ + @ApiModelProperty(value = "Error status, if any.") + + public String getStatusError() { + return statusError; + } + + + public void setStatusError(String statusError) { + this.statusError = statusError; + } + + + public CardOrderItemDeliveryStatus statusErrorMessage(String statusErrorMessage) { + + this.statusErrorMessage = statusErrorMessage; + return this; + } + + /** + * Error message, if any. + * @return statusErrorMessage + **/ + @ApiModelProperty(value = "Error message, if any.") + + public String getStatusErrorMessage() { + return statusErrorMessage; + } + + + public void setStatusErrorMessage(String statusErrorMessage) { + this.statusErrorMessage = statusErrorMessage; + } + + + public CardOrderItemDeliveryStatus trackingNumber(String trackingNumber) { + + this.trackingNumber = trackingNumber; + return this; + } + + /** + * Tracking number of the delivery. + * @return trackingNumber + **/ + @ApiModelProperty(value = "Tracking number of the delivery.") + + public String getTrackingNumber() { + return trackingNumber; + } + + + public void setTrackingNumber(String trackingNumber) { + this.trackingNumber = trackingNumber; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CardOrderItemDeliveryStatus cardOrderItemDeliveryStatus = (CardOrderItemDeliveryStatus) o; + return Objects.equals(this.status, cardOrderItemDeliveryStatus.status) && + Objects.equals(this.statusError, cardOrderItemDeliveryStatus.statusError) && + Objects.equals(this.statusErrorMessage, cardOrderItemDeliveryStatus.statusErrorMessage) && + Objects.equals(this.trackingNumber, cardOrderItemDeliveryStatus.trackingNumber); + } + + @Override + public int hashCode() { + return Objects.hash(status, statusError, statusErrorMessage, trackingNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardOrderItemDeliveryStatus {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusError: ").append(toIndentedString(statusError)).append("\n"); + sb.append(" statusErrorMessage: ").append(toIndentedString(statusErrorMessage)).append("\n"); + sb.append(" trackingNumber: ").append(toIndentedString(trackingNumber)).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("status"); + openapiFields.add("statusError"); + openapiFields.add("statusErrorMessage"); + openapiFields.add("trackingNumber"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardOrderItemDeliveryStatus.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CardOrderItemDeliveryStatus + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CardOrderItemDeliveryStatus.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CardOrderItemDeliveryStatus is not found in the empty JSON string", CardOrderItemDeliveryStatus.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CardOrderItemDeliveryStatus.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardOrderItemDeliveryStatus` properties.", entry.getKey())); + } + } + // 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 statusError + if (jsonObj.get("statusError") != null && !jsonObj.get("statusError").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `statusError` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statusError").toString())); + } + // validate the optional field statusErrorMessage + if (jsonObj.get("statusErrorMessage") != null && !jsonObj.get("statusErrorMessage").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `statusErrorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("statusErrorMessage").toString())); + } + // validate the optional field trackingNumber + if (jsonObj.get("trackingNumber") != null && !jsonObj.get("trackingNumber").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `trackingNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("trackingNumber").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CardOrderItemDeliveryStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CardOrderItemDeliveryStatus' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CardOrderItemDeliveryStatus.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CardOrderItemDeliveryStatus value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CardOrderItemDeliveryStatus read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CardOrderItemDeliveryStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardOrderItemDeliveryStatus + * @throws IOException if the JSON string is invalid with respect to CardOrderItemDeliveryStatus + */ + public static CardOrderItemDeliveryStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CardOrderItemDeliveryStatus.class); + } + + /** + * Convert an instance of CardOrderItemDeliveryStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java new file mode 100644 index 000000000..77ccbf7ec --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/CardOrderNotificationRequest.java @@ -0,0 +1,341 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.CardOrderItem; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * CardOrderNotificationRequest + */ + +public class CardOrderNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private CardOrderItem data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * Type of notification. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CREATED("balancePlatform.cardorder.created"), + + UPDATED("balancePlatform.cardorder.updated"); + + 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 CardOrderNotificationRequest() { + } + + public CardOrderNotificationRequest data(CardOrderItem data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public CardOrderItem getData() { + return data; + } + + + public void setData(CardOrderItem data) { + this.data = data; + } + + + public CardOrderNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public CardOrderNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of notification. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of notification.") + + 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; + } + CardOrderNotificationRequest cardOrderNotificationRequest = (CardOrderNotificationRequest) o; + return Objects.equals(this.data, cardOrderNotificationRequest.data) && + Objects.equals(this.environment, cardOrderNotificationRequest.environment) && + Objects.equals(this.type, cardOrderNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CardOrderNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CardOrderNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CardOrderNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CardOrderNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CardOrderNotificationRequest is not found in the empty JSON string", CardOrderNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CardOrderNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CardOrderNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CardOrderNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + CardOrderItem.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!CardOrderNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CardOrderNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CardOrderNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CardOrderNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CardOrderNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CardOrderNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CardOrderNotificationRequest + * @throws IOException if the JSON string is invalid with respect to CardOrderNotificationRequest + */ + public static CardOrderNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CardOrderNotificationRequest.class); + } + + /** + * Convert an instance of CardOrderNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Contact.java b/src/main/java/com/adyen/model/configurationwebhooks/Contact.java new file mode 100644 index 000000000..c1084145a --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Contact.java @@ -0,0 +1,416 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Address; +import com.adyen.model.configurationwebhooks.Name; +import com.adyen.model.configurationwebhooks.PersonalData; +import com.adyen.model.configurationwebhooks.PhoneNumber; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Contact + */ + +public class Contact { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Address address; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_FULL_PHONE_NUMBER = "fullPhoneNumber"; + @SerializedName(SERIALIZED_NAME_FULL_PHONE_NUMBER) + private String fullPhoneNumber; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private Name name; + + public static final String SERIALIZED_NAME_PERSONAL_DATA = "personalData"; + @SerializedName(SERIALIZED_NAME_PERSONAL_DATA) + private PersonalData personalData; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private PhoneNumber phoneNumber; + + public static final String SERIALIZED_NAME_WEB_ADDRESS = "webAddress"; + @SerializedName(SERIALIZED_NAME_WEB_ADDRESS) + private String webAddress; + + public Contact() { + } + + public Contact address(Address address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @ApiModelProperty(value = "") + + public Address getAddress() { + return address; + } + + + public void setAddress(Address address) { + this.address = address; + } + + + public Contact email(String email) { + + this.email = email; + return this; + } + + /** + * The e-mail address of the contact. + * @return email + **/ + @ApiModelProperty(value = "The e-mail address of the contact.") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public Contact fullPhoneNumber(String fullPhoneNumber) { + + this.fullPhoneNumber = fullPhoneNumber; + return this; + } + + /** + * The phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" + * @return fullPhoneNumber + **/ + @ApiModelProperty(value = "The phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\"") + + public String getFullPhoneNumber() { + return fullPhoneNumber; + } + + + public void setFullPhoneNumber(String fullPhoneNumber) { + this.fullPhoneNumber = fullPhoneNumber; + } + + + public Contact name(Name name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @ApiModelProperty(value = "") + + public Name getName() { + return name; + } + + + public void setName(Name name) { + this.name = name; + } + + + public Contact personalData(PersonalData personalData) { + + this.personalData = personalData; + return this; + } + + /** + * Get personalData + * @return personalData + **/ + @ApiModelProperty(value = "") + + public PersonalData getPersonalData() { + return personalData; + } + + + public void setPersonalData(PersonalData personalData) { + this.personalData = personalData; + } + + + public Contact phoneNumber(PhoneNumber phoneNumber) { + + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + **/ + @ApiModelProperty(value = "") + + public PhoneNumber getPhoneNumber() { + return phoneNumber; + } + + + public void setPhoneNumber(PhoneNumber phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public Contact webAddress(String webAddress) { + + this.webAddress = webAddress; + return this; + } + + /** + * The URL of the website of the contact. + * @return webAddress + **/ + @ApiModelProperty(value = "The URL of the website of the contact.") + + public String getWebAddress() { + return webAddress; + } + + + public void setWebAddress(String webAddress) { + this.webAddress = webAddress; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Contact contact = (Contact) o; + return Objects.equals(this.address, contact.address) && + Objects.equals(this.email, contact.email) && + Objects.equals(this.fullPhoneNumber, contact.fullPhoneNumber) && + Objects.equals(this.name, contact.name) && + Objects.equals(this.personalData, contact.personalData) && + Objects.equals(this.phoneNumber, contact.phoneNumber) && + Objects.equals(this.webAddress, contact.webAddress); + } + + @Override + public int hashCode() { + return Objects.hash(address, email, fullPhoneNumber, name, personalData, phoneNumber, webAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Contact {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" fullPhoneNumber: ").append(toIndentedString(fullPhoneNumber)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" personalData: ").append(toIndentedString(personalData)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" webAddress: ").append(toIndentedString(webAddress)).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("email"); + openapiFields.add("fullPhoneNumber"); + openapiFields.add("name"); + openapiFields.add("personalData"); + openapiFields.add("phoneNumber"); + openapiFields.add("webAddress"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Contact.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Contact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Contact.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Contact is not found in the empty JSON string", Contact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Contact.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Contact` properties.", entry.getKey())); + } + } + // validate the optional field `address` + if (jsonObj.getAsJsonObject("address") != null) { + Address.validateJsonObject(jsonObj.getAsJsonObject("address")); + } + // validate the optional field email + if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the optional field fullPhoneNumber + if (jsonObj.get("fullPhoneNumber") != null && !jsonObj.get("fullPhoneNumber").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `fullPhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fullPhoneNumber").toString())); + } + // validate the optional field `name` + if (jsonObj.getAsJsonObject("name") != null) { + Name.validateJsonObject(jsonObj.getAsJsonObject("name")); + } + // validate the optional field `personalData` + if (jsonObj.getAsJsonObject("personalData") != null) { + PersonalData.validateJsonObject(jsonObj.getAsJsonObject("personalData")); + } + // validate the optional field `phoneNumber` + if (jsonObj.getAsJsonObject("phoneNumber") != null) { + PhoneNumber.validateJsonObject(jsonObj.getAsJsonObject("phoneNumber")); + } + // validate the optional field webAddress + if (jsonObj.get("webAddress") != null && !jsonObj.get("webAddress").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Contact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Contact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Contact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Contact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Contact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Contact given an JSON string + * + * @param jsonString JSON string + * @return An instance of Contact + * @throws IOException if the JSON string is invalid with respect to Contact + */ + public static Contact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Contact.class); + } + + /** + * Convert an instance of Contact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java b/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java new file mode 100644 index 000000000..0db16ea6f --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/ContactDetails.java @@ -0,0 +1,325 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Address; +import com.adyen.model.configurationwebhooks.Phone; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * ContactDetails + */ + +public class ContactDetails { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Address address; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + private String email; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + private Phone phone; + + public static final String SERIALIZED_NAME_WEB_ADDRESS = "webAddress"; + @SerializedName(SERIALIZED_NAME_WEB_ADDRESS) + private String webAddress; + + public ContactDetails() { + } + + public ContactDetails address(Address address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @ApiModelProperty(required = true, value = "") + + public Address getAddress() { + return address; + } + + + public void setAddress(Address address) { + this.address = address; + } + + + public ContactDetails email(String email) { + + this.email = email; + return this; + } + + /** + * The email address of the account holder. + * @return email + **/ + @ApiModelProperty(required = true, value = "The email address of the account holder.") + + public String getEmail() { + return email; + } + + + public void setEmail(String email) { + this.email = email; + } + + + public ContactDetails phone(Phone phone) { + + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + **/ + @ApiModelProperty(required = true, value = "") + + public Phone getPhone() { + return phone; + } + + + public void setPhone(Phone phone) { + this.phone = phone; + } + + + public ContactDetails webAddress(String webAddress) { + + this.webAddress = webAddress; + return this; + } + + /** + * The URL of the account holder's website. + * @return webAddress + **/ + @ApiModelProperty(value = "The URL of the account holder's website.") + + public String getWebAddress() { + return webAddress; + } + + + public void setWebAddress(String webAddress) { + this.webAddress = webAddress; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContactDetails contactDetails = (ContactDetails) o; + return Objects.equals(this.address, contactDetails.address) && + Objects.equals(this.email, contactDetails.email) && + Objects.equals(this.phone, contactDetails.phone) && + Objects.equals(this.webAddress, contactDetails.webAddress); + } + + @Override + public int hashCode() { + return Objects.hash(address, email, phone, webAddress); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContactDetails {\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" webAddress: ").append(toIndentedString(webAddress)).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("email"); + openapiFields.add("phone"); + openapiFields.add("webAddress"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("address"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("phone"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ContactDetails.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ContactDetails + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ContactDetails.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ContactDetails is not found in the empty JSON string", ContactDetails.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ContactDetails.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ContactDetails` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ContactDetails.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 email + if (jsonObj.get("email") != null && !jsonObj.get("email").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the optional field `phone` + if (jsonObj.getAsJsonObject("phone") != null) { + Phone.validateJsonObject(jsonObj.getAsJsonObject("phone")); + } + // validate the optional field webAddress + if (jsonObj.get("webAddress") != null && !jsonObj.get("webAddress").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `webAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("webAddress").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ContactDetails.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ContactDetails' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ContactDetails.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ContactDetails value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ContactDetails read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ContactDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of ContactDetails + * @throws IOException if the JSON string is invalid with respect to ContactDetails + */ + public static ContactDetails fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ContactDetails.class); + } + + /** + * Convert an instance of ContactDetails to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/CronSweepSchedule.java b/src/main/java/com/adyen/model/configurationwebhooks/CronSweepSchedule.java new file mode 100644 index 000000000..539435ddd --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/CronSweepSchedule.java @@ -0,0 +1,311 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * CronSweepSchedule + */ + +public class CronSweepSchedule { + public static final String SERIALIZED_NAME_CRON_EXPRESSION = "cronExpression"; + @SerializedName(SERIALIZED_NAME_CRON_EXPRESSION) + private String cronExpression; + + /** + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + DAILY("daily"), + + WEEKLY("weekly"), + + MONTHLY("monthly"), + + BALANCE("balance"), + + CRON("cron"); + + 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 CronSweepSchedule() { + } + + public CronSweepSchedule cronExpression(String cronExpression) { + + this.cronExpression = cronExpression; + return this; + } + + /** + * A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: **&ast;**, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples. + * @return cronExpression + **/ + @ApiModelProperty(required = true, value = "A [cron expression](https://en.wikipedia.org/wiki/Cron#CRON_expression) that is used to set the sweep schedule. The schedule uses the time zone of the balance account. For example, **30 17 * * MON** schedules a sweep every Monday at 17:30. The expression must have five values separated by a single space in the following order: * Minute: **0-59** * Hour: **0-23** * Day of the month: **1-31** * Month: **1-12** or **JAN-DEC** * Day of the week: **0-7** (0 and 7 are Sunday) or **MON-SUN**. The following non-standard characters are supported: *****, **L**, **#**, **W** and **_/_**. See [crontab guru](https://crontab.guru/) for more examples.") + + public String getCronExpression() { + return cronExpression; + } + + + public void setCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + } + + + public CronSweepSchedule type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * @return type + **/ + @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.") + + 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; + } + CronSweepSchedule cronSweepSchedule = (CronSweepSchedule) o; + return Objects.equals(this.cronExpression, cronSweepSchedule.cronExpression) && + Objects.equals(this.type, cronSweepSchedule.type); + } + + @Override + public int hashCode() { + return Objects.hash(cronExpression, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CronSweepSchedule {\n"); + sb.append(" cronExpression: ").append(toIndentedString(cronExpression)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("cronExpression"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("cronExpression"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CronSweepSchedule.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CronSweepSchedule + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CronSweepSchedule.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CronSweepSchedule is not found in the empty JSON string", CronSweepSchedule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CronSweepSchedule.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CronSweepSchedule` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CronSweepSchedule.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 cronExpression + if (jsonObj.get("cronExpression") != null && !jsonObj.get("cronExpression").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `cronExpression` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cronExpression").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 (!CronSweepSchedule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CronSweepSchedule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CronSweepSchedule.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CronSweepSchedule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CronSweepSchedule read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CronSweepSchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of CronSweepSchedule + * @throws IOException if the JSON string is invalid with respect to CronSweepSchedule + */ + public static CronSweepSchedule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CronSweepSchedule.class); + } + + /** + * Convert an instance of CronSweepSchedule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java b/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java new file mode 100644 index 000000000..6abc388db --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Expiry.java @@ -0,0 +1,247 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Expiry + */ + +public class Expiry { + public static final String SERIALIZED_NAME_MONTH = "month"; + @SerializedName(SERIALIZED_NAME_MONTH) + private String month; + + public static final String SERIALIZED_NAME_YEAR = "year"; + @SerializedName(SERIALIZED_NAME_YEAR) + private String year; + + public Expiry() { + } + + public Expiry month(String month) { + + this.month = month; + return this; + } + + /** + * The month in which the card will expire. + * @return month + **/ + @ApiModelProperty(value = "The month in which the card will expire.") + + public String getMonth() { + return month; + } + + + public void setMonth(String month) { + this.month = month; + } + + + public Expiry year(String year) { + + this.year = year; + return this; + } + + /** + * The year in which the card will expire. + * @return year + **/ + @ApiModelProperty(value = "The year in which the card will expire.") + + public String getYear() { + return year; + } + + + public void setYear(String year) { + this.year = year; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Expiry expiry = (Expiry) o; + return Objects.equals(this.month, expiry.month) && + Objects.equals(this.year, expiry.year); + } + + @Override + public int hashCode() { + return Objects.hash(month, year); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Expiry {\n"); + sb.append(" month: ").append(toIndentedString(month)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).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("month"); + openapiFields.add("year"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Expiry.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Expiry + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Expiry.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Expiry is not found in the empty JSON string", Expiry.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Expiry.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Expiry` properties.", entry.getKey())); + } + } + // validate the optional field month + if (jsonObj.get("month") != null && !jsonObj.get("month").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `month` to be a primitive type in the JSON string but got `%s`", jsonObj.get("month").toString())); + } + // validate the optional field year + if (jsonObj.get("year") != null && !jsonObj.get("year").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("year").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Expiry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Expiry' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Expiry.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Expiry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Expiry read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Expiry given an JSON string + * + * @param jsonString JSON string + * @return An instance of Expiry + * @throws IOException if the JSON string is invalid with respect to Expiry + */ + public static Expiry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Expiry.class); + } + + /** + * Convert an instance of Expiry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java new file mode 100644 index 000000000..2e9c76995 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/IbanAccountIdentification.java @@ -0,0 +1,304 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IbanAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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/configurationwebhooks/JSON.java b/src/main/java/com/adyen/model/configurationwebhooks/JSON.java new file mode 100644 index 000000000..6b5c8147b --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/JSON.java @@ -0,0 +1,442 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +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.configurationwebhooks.AccountHolder.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.AccountHolderCapability.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.AccountHolderNotificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.AccountHolderNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.AccountSupportingEntityCapability.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Address.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Amount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Authentication.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Balance.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.BalanceAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.BalanceAccountNotificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.BalanceAccountNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.BalancePlatformNotificationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.BulkAddress.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Card.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.CardConfiguration.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.CardOrderItem.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.CardOrderItemDeliveryStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.CardOrderNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Contact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.ContactDetails.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.CronSweepSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Expiry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.IbanAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.JSONObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.JSONPath.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Name.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PaymentInstrument.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PaymentInstrumentBankAccount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PaymentInstrumentNotificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PaymentInstrumentReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PaymentNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PersonalData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Phone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.PhoneNumber.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.Resource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepConfiguration.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepConfigurationNotificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepConfigurationNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepConfigurationSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepConfigurationV2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepCounterparty.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.SweepSchedule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.configurationwebhooks.USLocalAccountIdentification.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/configurationwebhooks/JSONObject.java b/src/main/java/com/adyen/model/configurationwebhooks/JSONObject.java new file mode 100644 index 000000000..9fa10885c --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/JSONObject.java @@ -0,0 +1,266 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.JSONPath; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * JSONObject + */ + +public class JSONObject { + public static final String SERIALIZED_NAME_PATHS = "paths"; + @SerializedName(SERIALIZED_NAME_PATHS) + private List paths = null; + + public static final String SERIALIZED_NAME_ROOT_PATH = "rootPath"; + @SerializedName(SERIALIZED_NAME_ROOT_PATH) + private JSONPath rootPath; + + public JSONObject() { + } + + public JSONObject paths(List paths) { + + this.paths = paths; + return this; + } + + public JSONObject addPathsItem(JSONPath pathsItem) { + if (this.paths == null) { + this.paths = new ArrayList<>(); + } + this.paths.add(pathsItem); + return this; + } + + /** + * Get paths + * @return paths + **/ + @ApiModelProperty(value = "") + + public List getPaths() { + return paths; + } + + + public void setPaths(List paths) { + this.paths = paths; + } + + + public JSONObject rootPath(JSONPath rootPath) { + + this.rootPath = rootPath; + return this; + } + + /** + * Get rootPath + * @return rootPath + **/ + @ApiModelProperty(value = "") + + public JSONPath getRootPath() { + return rootPath; + } + + + public void setRootPath(JSONPath rootPath) { + this.rootPath = rootPath; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JSONObject jsONObject = (JSONObject) o; + return Objects.equals(this.paths, jsONObject.paths) && + Objects.equals(this.rootPath, jsONObject.rootPath); + } + + @Override + public int hashCode() { + return Objects.hash(paths, rootPath); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JSONObject {\n"); + sb.append(" paths: ").append(toIndentedString(paths)).append("\n"); + sb.append(" rootPath: ").append(toIndentedString(rootPath)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("paths"); + openapiFields.add("rootPath"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONObject.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JSONObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JSONObject.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JSONObject is not found in the empty JSON string", JSONObject.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JSONObject.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONObject` properties.", entry.getKey())); + } + } + JsonArray jsonArraypaths = jsonObj.getAsJsonArray("paths"); + if (jsonArraypaths != null) { + // ensure the json data is an array + if (!jsonObj.get("paths").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `paths` to be an array in the JSON string but got `%s`", jsonObj.get("paths").toString())); + } + + // validate the optional field `paths` (array) + for (int i = 0; i < jsonArraypaths.size(); i++) { + JSONPath.validateJsonObject(jsonArraypaths.get(i).getAsJsonObject()); + } + } + // validate the optional field `rootPath` + if (jsonObj.getAsJsonObject("rootPath") != null) { + JSONPath.validateJsonObject(jsonObj.getAsJsonObject("rootPath")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JSONObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JSONObject' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JSONObject.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JSONObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JSONObject read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JSONObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of JSONObject + * @throws IOException if the JSON string is invalid with respect to JSONObject + */ + public static JSONObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JSONObject.class); + } + + /** + * Convert an instance of JSONObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/JSONPath.java b/src/main/java/com/adyen/model/configurationwebhooks/JSONPath.java new file mode 100644 index 000000000..cd0da50b9 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/JSONPath.java @@ -0,0 +1,224 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * JSONPath + */ + +public class JSONPath { + public static final String SERIALIZED_NAME_CONTENT = "content"; + @SerializedName(SERIALIZED_NAME_CONTENT) + private List content = null; + + public JSONPath() { + } + + public JSONPath content(List content) { + + this.content = content; + return this; + } + + public JSONPath addContentItem(String contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + **/ + @ApiModelProperty(value = "") + + public List getContent() { + return content; + } + + + public void setContent(List content) { + this.content = content; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JSONPath jsONPath = (JSONPath) o; + return Objects.equals(this.content, jsONPath.content); + } + + @Override + public int hashCode() { + return Objects.hash(content); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JSONPath {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("content"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(JSONPath.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to JSONPath + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (JSONPath.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in JSONPath is not found in the empty JSON string", JSONPath.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!JSONPath.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `JSONPath` properties.", entry.getKey())); + } + } + // ensure the json data is an array + if (jsonObj.get("content") != null && !jsonObj.get("content").isJsonArray()) { + log.log(Level.WARNING, String.format("Expected the field `content` to be an array in the JSON string but got `%s`", jsonObj.get("content").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!JSONPath.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JSONPath' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JSONPath.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, JSONPath value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public JSONPath read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JSONPath given an JSON string + * + * @param jsonString JSON string + * @return An instance of JSONPath + * @throws IOException if the JSON string is invalid with respect to JSONPath + */ + public static JSONPath fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JSONPath.class); + } + + /** + * Convert an instance of JSONPath to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Name.java b/src/main/java/com/adyen/model/configurationwebhooks/Name.java new file mode 100644 index 000000000..567351c31 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Name.java @@ -0,0 +1,256 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Name + */ + +public class Name { + public static final String SERIALIZED_NAME_FIRST_NAME = "firstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "lastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + private String lastName; + + public Name() { + } + + public Name firstName(String firstName) { + + this.firstName = firstName; + return this; + } + + /** + * The first name. + * @return firstName + **/ + @ApiModelProperty(required = true, value = "The first name.") + + public String getFirstName() { + return firstName; + } + + + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + + public Name lastName(String lastName) { + + this.lastName = lastName; + return this; + } + + /** + * The last name. + * @return lastName + **/ + @ApiModelProperty(required = true, value = "The last name.") + + public String getLastName() { + return lastName; + } + + + public void setLastName(String lastName) { + this.lastName = lastName; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Name name = (Name) o; + return Objects.equals(this.firstName, name.firstName) && + Objects.equals(this.lastName, name.lastName); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).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("firstName"); + openapiFields.add("lastName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("firstName"); + openapiRequiredFields.add("lastName"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Name.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Name.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Name` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.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 firstName + if (jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonPrimitive()) { + log.log(Level.WARNING, 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 lastName + if (jsonObj.get("lastName") != null && !jsonObj.get("lastName").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `lastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Name.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Name' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Name.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Name value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Name read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Name.class); + } + + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java new file mode 100644 index 000000000..962412b53 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrument.java @@ -0,0 +1,638 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Card; +import com.adyen.model.configurationwebhooks.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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * PaymentInstrument + */ + +public class PaymentInstrument { + 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 **Requested**. Possible values: * **Active**: The payment instrument is active and can be used to make payments. * **Requested**: The payment instrument has been requested. This state is applicable for physical cards. * **Inactive**: The payment instrument is inactive and cannot be used to make payments. * **Suspended**: The payment instrument is temporarily suspended and cannot be used to make payments. * **Closed**: The payment instrument is permanently closed. This action cannot be undone. * **Stolen** * **Lost** + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("Active"), + + CLOSED("Closed"), + + INACTIVE("Inactive"), + + LOST("Lost"), + + REQUESTED("Requested"), + + STOLEN("Stolen"), + + SUSPENDED("Suspended"), + + BLOCKED("blocked"), + + DISCARDED("discarded"); + + 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; + + /** + * 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 PaymentInstrument() { + } + + public PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 PaymentInstrument 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 **Requested**. Possible values: * **Active**: The payment instrument is active and can be used to make payments. * **Requested**: The payment instrument has been requested. This state is applicable for physical cards. * **Inactive**: The payment instrument is inactive and cannot be used to make payments. * **Suspended**: The payment instrument is temporarily suspended and cannot be used to make payments. * **Closed**: The payment instrument is permanently closed. This action cannot be undone. * **Stolen** * **Lost** + * @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 **Requested**. Possible values: * **Active**: The payment instrument is active and can be used to make payments. * **Requested**: The payment instrument has been requested. This state is applicable for physical cards. * **Inactive**: The payment instrument is inactive and cannot be used to make payments. * **Suspended**: The payment instrument is temporarily suspended and cannot be used to make payments. * **Closed**: The payment instrument is permanently closed. This action cannot be undone. * **Stolen** * **Lost** ") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public PaymentInstrument 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; + } + PaymentInstrument paymentInstrument = (PaymentInstrument) o; + return Objects.equals(this.balanceAccountId, paymentInstrument.balanceAccountId) && + Objects.equals(this.bankAccount, paymentInstrument.bankAccount) && + Objects.equals(this.card, paymentInstrument.card) && + Objects.equals(this.description, paymentInstrument.description) && + Objects.equals(this.id, paymentInstrument.id) && + Objects.equals(this.issuingCountryCode, paymentInstrument.issuingCountryCode) && + Objects.equals(this.paymentInstrumentGroupId, paymentInstrument.paymentInstrumentGroupId) && + Objects.equals(this.reference, paymentInstrument.reference) && + Objects.equals(this.status, paymentInstrument.status) && + Objects.equals(this.type, paymentInstrument.type); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccountId, bankAccount, card, description, id, issuingCountryCode, paymentInstrumentGroupId, reference, status, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrument {\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(" 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("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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrument.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrument` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaymentInstrument.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()) { + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field `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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field issuingCountryCode + if (jsonObj.get("issuingCountryCode") != null && !jsonObj.get("issuingCountryCode").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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()); + } + // 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 (!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/configurationwebhooks/PaymentInstrumentBankAccount.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentBankAccount.java new file mode 100644 index 000000000..9c502a97b --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentBankAccount.java @@ -0,0 +1,287 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.IbanAccountIdentification; +import com.adyen.model.configurationwebhooks.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.configurationwebhooks.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 { + Logger.getLogger(IbanAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(USLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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/configurationwebhooks/PaymentInstrumentNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java new file mode 100644 index 000000000..dcceb95fb --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentNotificationData.java @@ -0,0 +1,248 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.PaymentInstrument; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * PaymentInstrumentNotificationData + */ + +public class PaymentInstrumentNotificationData { + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_PAYMENT_INSTRUMENT = "paymentInstrument"; + @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT) + private PaymentInstrument paymentInstrument; + + public PaymentInstrumentNotificationData() { + } + + public PaymentInstrumentNotificationData balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public PaymentInstrumentNotificationData 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; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInstrumentNotificationData paymentInstrumentNotificationData = (PaymentInstrumentNotificationData) o; + return Objects.equals(this.balancePlatform, paymentInstrumentNotificationData.balancePlatform) && + Objects.equals(this.paymentInstrument, paymentInstrumentNotificationData.paymentInstrument); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, paymentInstrument); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrumentNotificationData {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" paymentInstrument: ").append(toIndentedString(paymentInstrument)).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("balancePlatform"); + openapiFields.add("paymentInstrument"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentNotificationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentInstrumentNotificationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaymentInstrumentNotificationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentInstrumentNotificationData is not found in the empty JSON string", PaymentInstrumentNotificationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaymentInstrumentNotificationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentNotificationData` properties.", entry.getKey())); + } + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field `paymentInstrument` + if (jsonObj.getAsJsonObject("paymentInstrument") != null) { + PaymentInstrument.validateJsonObject(jsonObj.getAsJsonObject("paymentInstrument")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentInstrumentNotificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentInstrumentNotificationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentInstrumentNotificationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentInstrumentNotificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaymentInstrumentNotificationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentInstrumentNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrumentNotificationData + * @throws IOException if the JSON string is invalid with respect to PaymentInstrumentNotificationData + */ + public static PaymentInstrumentNotificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentInstrumentNotificationData.class); + } + + /** + * Convert an instance of PaymentInstrumentNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentReference.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentReference.java new file mode 100644 index 000000000..42d541eb5 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentInstrumentReference.java @@ -0,0 +1,222 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * PaymentInstrumentReference + */ + +public class PaymentInstrumentReference { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public PaymentInstrumentReference() { + } + + public PaymentInstrumentReference 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; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentInstrumentReference paymentInstrumentReference = (PaymentInstrumentReference) o; + return Objects.equals(this.id, paymentInstrumentReference.id); + } + + @Override + public int hashCode() { + return Objects.hash(id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentInstrumentReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).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("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrumentReference.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentInstrumentReference + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaymentInstrumentReference.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentInstrumentReference is not found in the empty JSON string", PaymentInstrumentReference.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaymentInstrumentReference.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrumentReference` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaymentInstrumentReference.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 id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PaymentInstrumentReference.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentInstrumentReference' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentInstrumentReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentInstrumentReference value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaymentInstrumentReference read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentInstrumentReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentInstrumentReference + * @throws IOException if the JSON string is invalid with respect to PaymentInstrumentReference + */ + public static PaymentInstrumentReference fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentInstrumentReference.class); + } + + /** + * Convert an instance of PaymentInstrumentReference to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java new file mode 100644 index 000000000..66e888f73 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PaymentNotificationRequest.java @@ -0,0 +1,341 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.PaymentInstrumentNotificationData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * PaymentNotificationRequest + */ + +public class PaymentNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private PaymentInstrumentNotificationData data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * Type of notification. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CREATED("balancePlatform.paymentInstrument.created"), + + UPDATED("balancePlatform.paymentInstrument.updated"); + + 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 PaymentNotificationRequest() { + } + + public PaymentNotificationRequest data(PaymentInstrumentNotificationData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public PaymentInstrumentNotificationData getData() { + return data; + } + + + public void setData(PaymentInstrumentNotificationData data) { + this.data = data; + } + + + public PaymentNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public PaymentNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of notification. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of notification.") + + 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; + } + PaymentNotificationRequest paymentNotificationRequest = (PaymentNotificationRequest) o; + return Objects.equals(this.data, paymentNotificationRequest.data) && + Objects.equals(this.environment, paymentNotificationRequest.environment) && + Objects.equals(this.type, paymentNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PaymentNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PaymentNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PaymentNotificationRequest is not found in the empty JSON string", PaymentNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PaymentNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PaymentNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + PaymentInstrumentNotificationData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!PaymentNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PaymentNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PaymentNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PaymentNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PaymentNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PaymentNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentNotificationRequest + * @throws IOException if the JSON string is invalid with respect to PaymentNotificationRequest + */ + public static PaymentNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PaymentNotificationRequest.class); + } + + /** + * Convert an instance of PaymentNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PersonalData.java b/src/main/java/com/adyen/model/configurationwebhooks/PersonalData.java new file mode 100644 index 000000000..fd0f1ea2e --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PersonalData.java @@ -0,0 +1,280 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * PersonalData + */ + +public class PersonalData { + public static final String SERIALIZED_NAME_DATE_OF_BIRTH = "dateOfBirth"; + @SerializedName(SERIALIZED_NAME_DATE_OF_BIRTH) + private String dateOfBirth; + + public static final String SERIALIZED_NAME_ID_NUMBER = "idNumber"; + @SerializedName(SERIALIZED_NAME_ID_NUMBER) + private String idNumber; + + public static final String SERIALIZED_NAME_NATIONALITY = "nationality"; + @SerializedName(SERIALIZED_NAME_NATIONALITY) + private String nationality; + + public PersonalData() { + } + + public PersonalData dateOfBirth(String dateOfBirth) { + + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31). + * @return dateOfBirth + **/ + @ApiModelProperty(value = "The date of birth of the person. The date should be in ISO-8601 format yyyy-mm-dd (e.g. 2000-01-31).") + + public String getDateOfBirth() { + return dateOfBirth; + } + + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + + public PersonalData idNumber(String idNumber) { + + this.idNumber = idNumber; + return this; + } + + /** + * An ID number of the person. + * @return idNumber + **/ + @ApiModelProperty(value = "An ID number of the person.") + + public String getIdNumber() { + return idNumber; + } + + + public void setIdNumber(String idNumber) { + this.idNumber = idNumber; + } + + + public PersonalData nationality(String nationality) { + + this.nationality = nationality; + return this; + } + + /** + * The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL'). + * @return nationality + **/ + @ApiModelProperty(value = "The nationality of the person represented by a two-character country code. >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL').") + + public String getNationality() { + return nationality; + } + + + public void setNationality(String nationality) { + this.nationality = nationality; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonalData personalData = (PersonalData) o; + return Objects.equals(this.dateOfBirth, personalData.dateOfBirth) && + Objects.equals(this.idNumber, personalData.idNumber) && + Objects.equals(this.nationality, personalData.nationality); + } + + @Override + public int hashCode() { + return Objects.hash(dateOfBirth, idNumber, nationality); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonalData {\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append(" idNumber: ").append(toIndentedString(idNumber)).append("\n"); + sb.append(" nationality: ").append(toIndentedString(nationality)).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("dateOfBirth"); + openapiFields.add("idNumber"); + openapiFields.add("nationality"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PersonalData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PersonalData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PersonalData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PersonalData is not found in the empty JSON string", PersonalData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PersonalData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PersonalData` properties.", entry.getKey())); + } + } + // validate the optional field dateOfBirth + if (jsonObj.get("dateOfBirth") != null && !jsonObj.get("dateOfBirth").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `dateOfBirth` to be a primitive type in the JSON string but got `%s`", jsonObj.get("dateOfBirth").toString())); + } + // validate the optional field idNumber + if (jsonObj.get("idNumber") != null && !jsonObj.get("idNumber").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `idNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("idNumber").toString())); + } + // validate the optional field nationality + if (jsonObj.get("nationality") != null && !jsonObj.get("nationality").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `nationality` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nationality").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PersonalData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PersonalData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PersonalData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PersonalData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PersonalData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PersonalData given an JSON string + * + * @param jsonString JSON string + * @return An instance of PersonalData + * @throws IOException if the JSON string is invalid with respect to PersonalData + */ + public static PersonalData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PersonalData.class); + } + + /** + * Convert an instance of PersonalData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Phone.java b/src/main/java/com/adyen/model/configurationwebhooks/Phone.java new file mode 100644 index 000000000..844424d65 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Phone.java @@ -0,0 +1,306 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Phone + */ + +public class Phone { + public static final String SERIALIZED_NAME_NUMBER = "number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + private String number; + + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + LANDLINE("Landline"), + + MOBILE("Mobile"); + + 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 Phone() { + } + + public Phone number(String number) { + + this.number = number; + return this; + } + + /** + * The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + * @return number + **/ + @ApiModelProperty(required = true, value = "The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**.") + + public String getNumber() { + return number; + } + + + public void setNumber(String number) { + this.number = number; + } + + + public Phone type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of phone number. Possible values: **Landline**, **Mobile**. ") + + 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; + } + Phone phone = (Phone) o; + return Objects.equals(this.number, phone.number) && + Objects.equals(this.type, phone.type); + } + + @Override + public int hashCode() { + return Objects.hash(number, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Phone {\n"); + sb.append(" number: ").append(toIndentedString(number)).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("number"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("number"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Phone.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Phone + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Phone.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Phone is not found in the empty JSON string", Phone.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Phone.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Phone` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Phone.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 number + if (jsonObj.get("number") != null && !jsonObj.get("number").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("number").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 (!Phone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Phone' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Phone.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Phone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Phone read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Phone given an JSON string + * + * @param jsonString JSON string + * @return An instance of Phone + * @throws IOException if the JSON string is invalid with respect to Phone + */ + public static Phone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Phone.class); + } + + /** + * Convert an instance of Phone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java b/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java new file mode 100644 index 000000000..0981d59c2 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/PhoneNumber.java @@ -0,0 +1,334 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * PhoneNumber + */ + +public class PhoneNumber { + public static final String SERIALIZED_NAME_PHONE_COUNTRY_CODE = "phoneCountryCode"; + @SerializedName(SERIALIZED_NAME_PHONE_COUNTRY_CODE) + private String phoneCountryCode; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "phoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + private String phoneNumber; + + /** + * The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. + */ + @JsonAdapter(PhoneTypeEnum.Adapter.class) + public enum PhoneTypeEnum { + FAX("Fax"), + + LANDLINE("Landline"), + + MOBILE("Mobile"), + + SIP("SIP"); + + private String value; + + PhoneTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PhoneTypeEnum fromValue(String value) { + for (PhoneTypeEnum b : PhoneTypeEnum.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 PhoneTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PhoneTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PhoneTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PHONE_TYPE = "phoneType"; + @SerializedName(SERIALIZED_NAME_PHONE_TYPE) + private PhoneTypeEnum phoneType; + + public PhoneNumber() { + } + + public PhoneNumber phoneCountryCode(String phoneCountryCode) { + + this.phoneCountryCode = phoneCountryCode; + return this; + } + + /** + * The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**. + * @return phoneCountryCode + **/ + @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; + } + + + public void setPhoneCountryCode(String phoneCountryCode) { + this.phoneCountryCode = phoneCountryCode; + } + + + public PhoneNumber phoneNumber(String phoneNumber) { + + this.phoneNumber = phoneNumber; + return this; + } + + /** + * The phone number. The inclusion of the phone number country code is not necessary. + * @return phoneNumber + **/ + @ApiModelProperty(value = "The phone number. The inclusion of the phone number country code is not necessary.") + + public String getPhoneNumber() { + return phoneNumber; + } + + + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public PhoneNumber phoneType(PhoneTypeEnum phoneType) { + + this.phoneType = phoneType; + return this; + } + + /** + * The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. + * @return phoneType + **/ + @ApiModelProperty(value = "The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**.") + + public PhoneTypeEnum getPhoneType() { + return phoneType; + } + + + public void setPhoneType(PhoneTypeEnum phoneType) { + this.phoneType = phoneType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneNumber phoneNumber = (PhoneNumber) o; + return Objects.equals(this.phoneCountryCode, phoneNumber.phoneCountryCode) && + Objects.equals(this.phoneNumber, phoneNumber.phoneNumber) && + Objects.equals(this.phoneType, phoneNumber.phoneType); + } + + @Override + public int hashCode() { + return Objects.hash(phoneCountryCode, phoneNumber, phoneType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneNumber {\n"); + sb.append(" phoneCountryCode: ").append(toIndentedString(phoneCountryCode)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" phoneType: ").append(toIndentedString(phoneType)).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("phoneCountryCode"); + openapiFields.add("phoneNumber"); + openapiFields.add("phoneType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PhoneNumber.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PhoneNumber + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PhoneNumber.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneNumber is not found in the empty JSON string", PhoneNumber.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PhoneNumber.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PhoneNumber` properties.", entry.getKey())); + } + } + // validate the optional field phoneCountryCode + if (jsonObj.get("phoneCountryCode") != null && !jsonObj.get("phoneCountryCode").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `phoneCountryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneCountryCode").toString())); + } + // validate the optional field phoneNumber + if (jsonObj.get("phoneNumber") != null && !jsonObj.get("phoneNumber").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `phoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneNumber").toString())); + } + // ensure the field phoneType can be parsed to an enum value + if (jsonObj.get("phoneType") != null) { + if(!jsonObj.get("phoneType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneType").toString())); + } + PhoneTypeEnum.fromValue(jsonObj.get("phoneType").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PhoneNumber.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneNumber' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneNumber.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PhoneNumber value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PhoneNumber read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneNumber given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneNumber + * @throws IOException if the JSON string is invalid with respect to PhoneNumber + */ + public static PhoneNumber fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneNumber.class); + } + + /** + * Convert an instance of PhoneNumber to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/Resource.java b/src/main/java/com/adyen/model/configurationwebhooks/Resource.java new file mode 100644 index 000000000..88695ded1 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/Resource.java @@ -0,0 +1,277 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * Resource + */ + +public class Resource { + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private OffsetDateTime creationDate; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public Resource() { + } + + public Resource balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public Resource creationDate(OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.") + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public Resource id(String id) { + + this.id = id; + return this; + } + + /** + * The ID of the resource. + * @return id + **/ + @ApiModelProperty(value = "The ID of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Resource resource = (Resource) o; + return Objects.equals(this.balancePlatform, resource.balancePlatform) && + Objects.equals(this.creationDate, resource.creationDate) && + Objects.equals(this.id, resource.id); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, creationDate, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Resource {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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("balancePlatform"); + openapiFields.add("creationDate"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Resource.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Resource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Resource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Resource is not found in the empty JSON string", Resource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Resource.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Resource` properties.", entry.getKey())); + } + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Resource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Resource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Resource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Resource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Resource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Resource given an JSON string + * + * @param jsonString JSON string + * @return An instance of Resource + * @throws IOException if the JSON string is invalid with respect to Resource + */ + public static Resource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Resource.class); + } + + /** + * Convert an instance of Resource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfiguration.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfiguration.java new file mode 100644 index 000000000..d0674975c --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfiguration.java @@ -0,0 +1,622 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Amount; +import com.adyen.model.configurationwebhooks.SweepConfigurationSchedule; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * SweepConfiguration + */ + +public class SweepConfiguration { + 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_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_SCHEDULE = "schedule"; + @SerializedName(SERIALIZED_NAME_SCHEDULE) + private SweepConfigurationSchedule schedule; + + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + INACTIVE("inactive"); + + 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_SWEEP_AMOUNT = "sweepAmount"; + @SerializedName(SERIALIZED_NAME_SWEEP_AMOUNT) + private Amount sweepAmount; + + public static final String SERIALIZED_NAME_TARGET_AMOUNT = "targetAmount"; + @SerializedName(SERIALIZED_NAME_TARGET_AMOUNT) + private Amount targetAmount; + + public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID) + private String transferInstrumentId; + + public static final String SERIALIZED_NAME_TRIGGER_AMOUNT = "triggerAmount"; + @SerializedName(SERIALIZED_NAME_TRIGGER_AMOUNT) + private Amount triggerAmount; + + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PULL("pull"), + + PUSH("push"); + + 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.PUSH; + + public SweepConfiguration() { + } + + public SweepConfiguration balanceAccountId(String balanceAccountId) { + + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + * @return balanceAccountId + **/ + @ApiModelProperty(value = "The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**.") + + public String getBalanceAccountId() { + return balanceAccountId; + } + + + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public SweepConfiguration id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the sweep. + * @return id + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the sweep.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public SweepConfiguration merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } + + /** + * The merchant account that will be the source of funds. You can only use this if you are processing payments with Adyen. This can only be used for sweeps of `type` **pull** and `schedule.type` **balance**. + * @return merchantAccount + **/ + @ApiModelProperty(value = "The merchant account that will be the source of funds. You can only use this if you are processing payments with Adyen. This can only be used for sweeps of `type` **pull** and `schedule.type` **balance**.") + + public String getMerchantAccount() { + return merchantAccount; + } + + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + + public SweepConfiguration schedule(SweepConfigurationSchedule schedule) { + + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @ApiModelProperty(required = true, value = "") + + public SweepConfigurationSchedule getSchedule() { + return schedule; + } + + + public void setSchedule(SweepConfigurationSchedule schedule) { + this.schedule = schedule; + } + + + public SweepConfiguration status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * @return status + **/ + @ApiModelProperty(value = "The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. ") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public SweepConfiguration sweepAmount(Amount sweepAmount) { + + this.sweepAmount = sweepAmount; + return this; + } + + /** + * Get sweepAmount + * @return sweepAmount + **/ + @ApiModelProperty(value = "") + + public Amount getSweepAmount() { + return sweepAmount; + } + + + public void setSweepAmount(Amount sweepAmount) { + this.sweepAmount = sweepAmount; + } + + + public SweepConfiguration targetAmount(Amount targetAmount) { + + this.targetAmount = targetAmount; + return this; + } + + /** + * Get targetAmount + * @return targetAmount + **/ + @ApiModelProperty(value = "") + + public Amount getTargetAmount() { + return targetAmount; + } + + + public void setTargetAmount(Amount targetAmount) { + this.targetAmount = targetAmount; + } + + + public SweepConfiguration transferInstrumentId(String transferInstrumentId) { + + this.transferInstrumentId = transferInstrumentId; + return this; + } + + /** + * The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * @return transferInstrumentId + **/ + @ApiModelProperty(value = "The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact.") + + public String getTransferInstrumentId() { + return transferInstrumentId; + } + + + public void setTransferInstrumentId(String transferInstrumentId) { + this.transferInstrumentId = transferInstrumentId; + } + + + public SweepConfiguration triggerAmount(Amount triggerAmount) { + + this.triggerAmount = triggerAmount; + return this; + } + + /** + * Get triggerAmount + * @return triggerAmount + **/ + @ApiModelProperty(value = "") + + public Amount getTriggerAmount() { + return triggerAmount; + } + + + public void setTriggerAmount(Amount triggerAmount) { + this.triggerAmount = triggerAmount; + } + + + public SweepConfiguration type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * @return type + **/ + @ApiModelProperty(value = "The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account.") + + 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; + } + SweepConfiguration sweepConfiguration = (SweepConfiguration) o; + return Objects.equals(this.balanceAccountId, sweepConfiguration.balanceAccountId) && + Objects.equals(this.id, sweepConfiguration.id) && + Objects.equals(this.merchantAccount, sweepConfiguration.merchantAccount) && + Objects.equals(this.schedule, sweepConfiguration.schedule) && + Objects.equals(this.status, sweepConfiguration.status) && + Objects.equals(this.sweepAmount, sweepConfiguration.sweepAmount) && + Objects.equals(this.targetAmount, sweepConfiguration.targetAmount) && + Objects.equals(this.transferInstrumentId, sweepConfiguration.transferInstrumentId) && + Objects.equals(this.triggerAmount, sweepConfiguration.triggerAmount) && + Objects.equals(this.type, sweepConfiguration.type); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccountId, id, merchantAccount, schedule, status, sweepAmount, targetAmount, transferInstrumentId, triggerAmount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SweepConfiguration {\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sweepAmount: ").append(toIndentedString(sweepAmount)).append("\n"); + sb.append(" targetAmount: ").append(toIndentedString(targetAmount)).append("\n"); + sb.append(" transferInstrumentId: ").append(toIndentedString(transferInstrumentId)).append("\n"); + sb.append(" triggerAmount: ").append(toIndentedString(triggerAmount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + 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("id"); + openapiFields.add("merchantAccount"); + openapiFields.add("schedule"); + openapiFields.add("status"); + openapiFields.add("sweepAmount"); + openapiFields.add("targetAmount"); + openapiFields.add("transferInstrumentId"); + openapiFields.add("triggerAmount"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("schedule"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepConfiguration.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SweepConfiguration + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SweepConfiguration.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SweepConfiguration is not found in the empty JSON string", SweepConfiguration.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SweepConfiguration.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepConfiguration` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SweepConfiguration.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()) { + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + log.log(Level.WARNING, 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 `schedule` + if (jsonObj.getAsJsonObject("schedule") != null) { + SweepConfigurationSchedule.validateJsonObject(jsonObj.getAsJsonObject("schedule")); + } + // 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 `sweepAmount` + if (jsonObj.getAsJsonObject("sweepAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("sweepAmount")); + } + // validate the optional field `targetAmount` + if (jsonObj.getAsJsonObject("targetAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("targetAmount")); + } + // validate the optional field transferInstrumentId + if (jsonObj.get("transferInstrumentId") != null && !jsonObj.get("transferInstrumentId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); + } + // validate the optional field `triggerAmount` + if (jsonObj.getAsJsonObject("triggerAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("triggerAmount")); + } + // 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 (!SweepConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepConfiguration' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SweepConfiguration.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SweepConfiguration read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SweepConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepConfiguration + * @throws IOException if the JSON string is invalid with respect to SweepConfiguration + */ + public static SweepConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepConfiguration.class); + } + + /** + * Convert an instance of SweepConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java new file mode 100644 index 000000000..dae63d688 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationData.java @@ -0,0 +1,281 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.SweepConfigurationV2; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * SweepConfigurationNotificationData + */ + +public class SweepConfigurationNotificationData { + public static final String SERIALIZED_NAME_ACCOUNT_ID = "accountId"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_ID) + private String accountId; + + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_SWEEP = "sweep"; + @SerializedName(SERIALIZED_NAME_SWEEP) + private SweepConfigurationV2 sweep; + + public SweepConfigurationNotificationData() { + } + + public SweepConfigurationNotificationData accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * The unique identifier of the balance account for which the sweep was configured. + * @return accountId + **/ + @ApiModelProperty(value = "The unique identifier of the balance account for which the sweep was configured.") + + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public SweepConfigurationNotificationData balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public SweepConfigurationNotificationData sweep(SweepConfigurationV2 sweep) { + + this.sweep = sweep; + return this; + } + + /** + * Get sweep + * @return sweep + **/ + @ApiModelProperty(value = "") + + public SweepConfigurationV2 getSweep() { + return sweep; + } + + + public void setSweep(SweepConfigurationV2 sweep) { + this.sweep = sweep; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SweepConfigurationNotificationData sweepConfigurationNotificationData = (SweepConfigurationNotificationData) o; + return Objects.equals(this.accountId, sweepConfigurationNotificationData.accountId) && + Objects.equals(this.balancePlatform, sweepConfigurationNotificationData.balancePlatform) && + Objects.equals(this.sweep, sweepConfigurationNotificationData.sweep); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, balancePlatform, sweep); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SweepConfigurationNotificationData {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" sweep: ").append(toIndentedString(sweep)).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("accountId"); + openapiFields.add("balancePlatform"); + openapiFields.add("sweep"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepConfigurationNotificationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SweepConfigurationNotificationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SweepConfigurationNotificationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SweepConfigurationNotificationData is not found in the empty JSON string", SweepConfigurationNotificationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SweepConfigurationNotificationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepConfigurationNotificationData` properties.", entry.getKey())); + } + } + // validate the optional field accountId + if (jsonObj.get("accountId") != null && !jsonObj.get("accountId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `accountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("accountId").toString())); + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field `sweep` + if (jsonObj.getAsJsonObject("sweep") != null) { + SweepConfigurationV2.validateJsonObject(jsonObj.getAsJsonObject("sweep")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SweepConfigurationNotificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepConfigurationNotificationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SweepConfigurationNotificationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepConfigurationNotificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SweepConfigurationNotificationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SweepConfigurationNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepConfigurationNotificationData + * @throws IOException if the JSON string is invalid with respect to SweepConfigurationNotificationData + */ + public static SweepConfigurationNotificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepConfigurationNotificationData.class); + } + + /** + * Convert an instance of SweepConfigurationNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java new file mode 100644 index 000000000..15433f3ba --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationNotificationRequest.java @@ -0,0 +1,343 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.SweepConfigurationNotificationData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * SweepConfigurationNotificationRequest + */ + +public class SweepConfigurationNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private SweepConfigurationNotificationData data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * Type of notification. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CREATED("balancePlatform.balanceAccountSweep.created"), + + UPDATED("balancePlatform.balanceAccountSweep.updated"), + + DELETED("balancePlatform.balanceAccountSweep.deleted"); + + 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 SweepConfigurationNotificationRequest() { + } + + public SweepConfigurationNotificationRequest data(SweepConfigurationNotificationData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public SweepConfigurationNotificationData getData() { + return data; + } + + + public void setData(SweepConfigurationNotificationData data) { + this.data = data; + } + + + public SweepConfigurationNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public SweepConfigurationNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of notification. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of notification.") + + 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; + } + SweepConfigurationNotificationRequest sweepConfigurationNotificationRequest = (SweepConfigurationNotificationRequest) o; + return Objects.equals(this.data, sweepConfigurationNotificationRequest.data) && + Objects.equals(this.environment, sweepConfigurationNotificationRequest.environment) && + Objects.equals(this.type, sweepConfigurationNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SweepConfigurationNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepConfigurationNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SweepConfigurationNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SweepConfigurationNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SweepConfigurationNotificationRequest is not found in the empty JSON string", SweepConfigurationNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SweepConfigurationNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepConfigurationNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SweepConfigurationNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + SweepConfigurationNotificationData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!SweepConfigurationNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepConfigurationNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SweepConfigurationNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepConfigurationNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SweepConfigurationNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SweepConfigurationNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepConfigurationNotificationRequest + * @throws IOException if the JSON string is invalid with respect to SweepConfigurationNotificationRequest + */ + public static SweepConfigurationNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepConfigurationNotificationRequest.class); + } + + /** + * Convert an instance of SweepConfigurationNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationSchedule.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationSchedule.java new file mode 100644 index 000000000..21805a307 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationSchedule.java @@ -0,0 +1,287 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.CronSweepSchedule; +import com.adyen.model.configurationwebhooks.SweepSchedule; +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.configurationwebhooks.JSON; + + +public class SweepConfigurationSchedule extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SweepConfigurationSchedule.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SweepConfigurationSchedule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepConfigurationSchedule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterCronSweepSchedule = gson.getDelegateAdapter(this, TypeToken.get(CronSweepSchedule.class)); + final TypeAdapter adapterSweepSchedule = gson.getDelegateAdapter(this, TypeToken.get(SweepSchedule.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepConfigurationSchedule value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `CronSweepSchedule` + if (value.getActualInstance() instanceof CronSweepSchedule) { + JsonObject obj = adapterCronSweepSchedule.toJsonTree((CronSweepSchedule)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + // check if the actual instance is of the type `SweepSchedule` + if (value.getActualInstance() instanceof SweepSchedule) { + JsonObject obj = adapterSweepSchedule.toJsonTree((SweepSchedule)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: CronSweepSchedule, SweepSchedule"); + } + + @Override + public SweepConfigurationSchedule 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 CronSweepSchedule + try { + // validate the JSON object to see if any exception is thrown + CronSweepSchedule.validateJsonObject(jsonObject); + actualAdapter = adapterCronSweepSchedule; + match++; + log.log(Level.FINER, "Input data matches schema 'CronSweepSchedule'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for CronSweepSchedule failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'CronSweepSchedule'", e); + } + + // deserialize SweepSchedule + try { + // validate the JSON object to see if any exception is thrown + SweepSchedule.validateJsonObject(jsonObject); + actualAdapter = adapterSweepSchedule; + match++; + log.log(Level.FINER, "Input data matches schema 'SweepSchedule'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SweepSchedule failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SweepSchedule'", e); + } + + if (match == 1) { + SweepConfigurationSchedule ret = new SweepConfigurationSchedule(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for SweepConfigurationSchedule: %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 SweepConfigurationSchedule() { + super("oneOf", Boolean.FALSE); + } + + public SweepConfigurationSchedule(CronSweepSchedule o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SweepConfigurationSchedule(SweepSchedule o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CronSweepSchedule", new GenericType() { + }); + schemas.put("SweepSchedule", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return SweepConfigurationSchedule.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * CronSweepSchedule, SweepSchedule + * + * It could be an instance of the 'oneOf' schemas. + * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof CronSweepSchedule) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof SweepSchedule) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be CronSweepSchedule, SweepSchedule"); + } + + /** + * Get the actual instance, which can be the following: + * CronSweepSchedule, SweepSchedule + * + * @return The actual instance (CronSweepSchedule, SweepSchedule) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CronSweepSchedule`. If the actual instance is not `CronSweepSchedule`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `CronSweepSchedule` + * @throws ClassCastException if the instance is not `CronSweepSchedule` + */ + public CronSweepSchedule getCronSweepSchedule() throws ClassCastException { + return (CronSweepSchedule)super.getActualInstance(); + } + + /** + * Get the actual instance of `SweepSchedule`. If the actual instance is not `SweepSchedule`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SweepSchedule` + * @throws ClassCastException if the instance is not `SweepSchedule` + */ + public SweepSchedule getSweepSchedule() throws ClassCastException { + return (SweepSchedule)super.getActualInstance(); + } + + + /** + * 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 SweepConfigurationSchedule + */ + 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 CronSweepSchedule + try { + Logger.getLogger(CronSweepSchedule.class.getName()).setLevel(Level.OFF); + CronSweepSchedule.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for CronSweepSchedule failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with SweepSchedule + try { + Logger.getLogger(SweepSchedule.class.getName()).setLevel(Level.OFF); + SweepSchedule.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SweepSchedule failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for SweepConfigurationSchedule with oneOf schemas: CronSweepSchedule, SweepSchedule. %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 SweepConfigurationSchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepConfigurationSchedule + * @throws IOException if the JSON string is invalid with respect to SweepConfigurationSchedule + */ + public static SweepConfigurationSchedule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepConfigurationSchedule.class); + } + + /** + * Convert an instance of SweepConfigurationSchedule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java new file mode 100644 index 000000000..536a32a4b --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepConfigurationV2.java @@ -0,0 +1,730 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.configurationwebhooks.Amount; +import com.adyen.model.configurationwebhooks.SweepConfigurationSchedule; +import com.adyen.model.configurationwebhooks.SweepCounterparty; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * SweepConfigurationV2 + */ + +public class SweepConfigurationV2 { + public static final String SERIALIZED_NAME_COUNTERPARTY = "counterparty"; + @SerializedName(SERIALIZED_NAME_COUNTERPARTY) + private SweepCounterparty counterparty; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + 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; + + /** + * 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 SweepConfigurationSchedule schedule; + + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACTIVE("active"), + + INACTIVE("inactive"); + + 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_SWEEP_AMOUNT = "sweepAmount"; + @SerializedName(SERIALIZED_NAME_SWEEP_AMOUNT) + private Amount sweepAmount; + + public static final String SERIALIZED_NAME_TARGET_AMOUNT = "targetAmount"; + @SerializedName(SERIALIZED_NAME_TARGET_AMOUNT) + private Amount targetAmount; + + public static final String SERIALIZED_NAME_TRIGGER_AMOUNT = "triggerAmount"; + @SerializedName(SERIALIZED_NAME_TRIGGER_AMOUNT) + private Amount triggerAmount; + + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PULL("pull"), + + PUSH("push"); + + 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.PUSH; + + public SweepConfigurationV2() { + } + + public SweepConfigurationV2 counterparty(SweepCounterparty counterparty) { + + this.counterparty = counterparty; + return this; + } + + /** + * Get counterparty + * @return counterparty + **/ + @ApiModelProperty(required = true, value = "") + + public SweepCounterparty getCounterparty() { + return counterparty; + } + + + public void setCounterparty(SweepCounterparty counterparty) { + this.counterparty = counterparty; + } + + + public SweepConfigurationV2 currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public SweepConfigurationV2 description(String description) { + + this.description = description; + return this; + } + + /** + * The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters. + * @return description + **/ + @ApiModelProperty(value = "The message that will be used in the sweep transfer's description body with a maximum length of 140 characters. If the message is longer after replacing placeholders, the message will be cut off at 140 characters.") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public SweepConfigurationV2 id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the sweep. + * @return id + **/ + @ApiModelProperty(required = true, value = "The unique identifier of the sweep.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public SweepConfigurationV2 reason(ReasonEnum reason) { + + this.reason = reason; + return this; + } + + /** + * The reason for disabling the sweep. + * @return reason + **/ + @ApiModelProperty(value = "The reason for disabling the sweep.") + + public ReasonEnum getReason() { + return reason; + } + + + public void setReason(ReasonEnum reason) { + this.reason = reason; + } + + + public SweepConfigurationV2 schedule(SweepConfigurationSchedule schedule) { + + this.schedule = schedule; + return this; + } + + /** + * Get schedule + * @return schedule + **/ + @ApiModelProperty(required = true, value = "") + + public SweepConfigurationSchedule getSchedule() { + return schedule; + } + + + public void setSchedule(SweepConfigurationSchedule schedule) { + this.schedule = schedule; + } + + + public SweepConfigurationV2 status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + * @return status + **/ + @ApiModelProperty(value = "The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. ") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public SweepConfigurationV2 sweepAmount(Amount sweepAmount) { + + this.sweepAmount = sweepAmount; + return this; + } + + /** + * Get sweepAmount + * @return sweepAmount + **/ + @ApiModelProperty(value = "") + + public Amount getSweepAmount() { + return sweepAmount; + } + + + public void setSweepAmount(Amount sweepAmount) { + this.sweepAmount = sweepAmount; + } + + + public SweepConfigurationV2 targetAmount(Amount targetAmount) { + + this.targetAmount = targetAmount; + return this; + } + + /** + * Get targetAmount + * @return targetAmount + **/ + @ApiModelProperty(value = "") + + public Amount getTargetAmount() { + return targetAmount; + } + + + public void setTargetAmount(Amount targetAmount) { + this.targetAmount = targetAmount; + } + + + public SweepConfigurationV2 triggerAmount(Amount triggerAmount) { + + this.triggerAmount = triggerAmount; + return this; + } + + /** + * Get triggerAmount + * @return triggerAmount + **/ + @ApiModelProperty(value = "") + + public Amount getTriggerAmount() { + return triggerAmount; + } + + + public void setTriggerAmount(Amount triggerAmount) { + this.triggerAmount = triggerAmount; + } + + + public SweepConfigurationV2 type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + * @return type + **/ + @ApiModelProperty(value = "The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account.") + + 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; + } + SweepConfigurationV2 sweepConfigurationV2 = (SweepConfigurationV2) o; + return 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.reason, sweepConfigurationV2.reason) && + Objects.equals(this.schedule, sweepConfigurationV2.schedule) && + Objects.equals(this.status, sweepConfigurationV2.status) && + Objects.equals(this.sweepAmount, sweepConfigurationV2.sweepAmount) && + Objects.equals(this.targetAmount, sweepConfigurationV2.targetAmount) && + Objects.equals(this.triggerAmount, sweepConfigurationV2.triggerAmount) && + Objects.equals(this.type, sweepConfigurationV2.type); + } + + @Override + public int hashCode() { + return Objects.hash(counterparty, currency, description, id, reason, schedule, status, sweepAmount, targetAmount, triggerAmount, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SweepConfigurationV2 {\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(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" schedule: ").append(toIndentedString(schedule)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sweepAmount: ").append(toIndentedString(sweepAmount)).append("\n"); + sb.append(" targetAmount: ").append(toIndentedString(targetAmount)).append("\n"); + sb.append(" triggerAmount: ").append(toIndentedString(triggerAmount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + 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("currency"); + openapiFields.add("description"); + openapiFields.add("id"); + openapiFields.add("reason"); + openapiFields.add("schedule"); + openapiFields.add("status"); + openapiFields.add("sweepAmount"); + openapiFields.add("targetAmount"); + openapiFields.add("triggerAmount"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("counterparty"); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("schedule"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepConfigurationV2.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SweepConfigurationV2 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SweepConfigurationV2.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SweepConfigurationV2 is not found in the empty JSON string", SweepConfigurationV2.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SweepConfigurationV2.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepConfigurationV2` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SweepConfigurationV2.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) { + SweepCounterparty.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // 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) { + SweepConfigurationSchedule.validateJsonObject(jsonObj.getAsJsonObject("schedule")); + } + // 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 `sweepAmount` + if (jsonObj.getAsJsonObject("sweepAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("sweepAmount")); + } + // validate the optional field `targetAmount` + if (jsonObj.getAsJsonObject("targetAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("targetAmount")); + } + // validate the optional field `triggerAmount` + if (jsonObj.getAsJsonObject("triggerAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("triggerAmount")); + } + // 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 (!SweepConfigurationV2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepConfigurationV2' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SweepConfigurationV2.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepConfigurationV2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SweepConfigurationV2 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SweepConfigurationV2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepConfigurationV2 + * @throws IOException if the JSON string is invalid with respect to SweepConfigurationV2 + */ + public static SweepConfigurationV2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepConfigurationV2.class); + } + + /** + * Convert an instance of SweepConfigurationV2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java new file mode 100644 index 000000000..824541f68 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepCounterparty.java @@ -0,0 +1,280 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * SweepCounterparty + */ + +public class SweepCounterparty { + 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_MERCHANT_ACCOUNT = "merchantAccount"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ACCOUNT) + private String merchantAccount; + + public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID) + private String transferInstrumentId; + + public SweepCounterparty() { + } + + public SweepCounterparty balanceAccountId(String balanceAccountId) { + + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + * @return balanceAccountId + **/ + @ApiModelProperty(value = "The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**.") + + public String getBalanceAccountId() { + return balanceAccountId; + } + + + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public SweepCounterparty merchantAccount(String merchantAccount) { + + this.merchantAccount = merchantAccount; + return this; + } + + /** + * The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + * @return merchantAccount + **/ + @ApiModelProperty(value = "The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**.") + + public String getMerchantAccount() { + return merchantAccount; + } + + + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + } + + + public SweepCounterparty transferInstrumentId(String transferInstrumentId) { + + this.transferInstrumentId = transferInstrumentId; + return this; + } + + /** + * The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + * @return transferInstrumentId + **/ + @ApiModelProperty(value = "The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact.") + + 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; + } + SweepCounterparty sweepCounterparty = (SweepCounterparty) o; + return Objects.equals(this.balanceAccountId, sweepCounterparty.balanceAccountId) && + Objects.equals(this.merchantAccount, sweepCounterparty.merchantAccount) && + Objects.equals(this.transferInstrumentId, sweepCounterparty.transferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccountId, merchantAccount, transferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SweepCounterparty {\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).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("balanceAccountId"); + openapiFields.add("merchantAccount"); + openapiFields.add("transferInstrumentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepCounterparty.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SweepCounterparty + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SweepCounterparty.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SweepCounterparty is not found in the empty JSON string", SweepCounterparty.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SweepCounterparty.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepCounterparty` properties.", entry.getKey())); + } + } + // validate the optional field balanceAccountId + if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field merchantAccount + if (jsonObj.get("merchantAccount") != null && !jsonObj.get("merchantAccount").isJsonPrimitive()) { + log.log(Level.WARNING, 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 transferInstrumentId + if (jsonObj.get("transferInstrumentId") != null && !jsonObj.get("transferInstrumentId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!SweepCounterparty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepCounterparty' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SweepCounterparty.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepCounterparty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SweepCounterparty read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SweepCounterparty given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepCounterparty + * @throws IOException if the JSON string is invalid with respect to SweepCounterparty + */ + public static SweepCounterparty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepCounterparty.class); + } + + /** + * Convert an instance of SweepCounterparty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java b/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java new file mode 100644 index 000000000..4eb8a0b90 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/SweepSchedule.java @@ -0,0 +1,270 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.JSON; + +/** + * SweepSchedule + */ + +public class SweepSchedule { + /** + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + DAILY("daily"), + + WEEKLY("weekly"), + + MONTHLY("monthly"), + + BALANCE("balance"), + + CRON("cron"); + + 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 SweepSchedule() { + } + + public SweepSchedule type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + * @return type + **/ + @ApiModelProperty(value = "The schedule type. Possible values: * **cron**: push out funds based on a cron expression. * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`.") + + 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; + } + SweepSchedule sweepSchedule = (SweepSchedule) o; + return Objects.equals(this.type, sweepSchedule.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SweepSchedule {\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("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SweepSchedule.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SweepSchedule + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SweepSchedule.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SweepSchedule is not found in the empty JSON string", SweepSchedule.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SweepSchedule.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SweepSchedule` properties.", entry.getKey())); + } + } + // 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 (!SweepSchedule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SweepSchedule' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SweepSchedule.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, SweepSchedule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public SweepSchedule read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SweepSchedule given an JSON string + * + * @param jsonString JSON string + * @return An instance of SweepSchedule + * @throws IOException if the JSON string is invalid with respect to SweepSchedule + */ + public static SweepSchedule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SweepSchedule.class); + } + + /** + * Convert an instance of SweepSchedule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/configurationwebhooks/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/configurationwebhooks/USLocalAccountIdentification.java new file mode 100644 index 000000000..2a1d4df38 --- /dev/null +++ b/src/main/java/com/adyen/model/configurationwebhooks/USLocalAccountIdentification.java @@ -0,0 +1,421 @@ +/* + * Configuration webhooks + * + * 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.configurationwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.configurationwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(USLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/reportwebhooks/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/reportwebhooks/AbstractOpenApiSchema.java new file mode 100644 index 000000000..3d2864bad --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/AbstractOpenApiSchema.java @@ -0,0 +1,144 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +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/reportwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java new file mode 100644 index 000000000..75d0140c6 --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/BalancePlatformNotificationResponse.java @@ -0,0 +1,214 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.reportwebhooks.JSON; + +/** + * BalancePlatformNotificationResponse + */ + +public class BalancePlatformNotificationResponse { + public static final String SERIALIZED_NAME_NOTIFICATION_RESPONSE = "notificationResponse"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_RESPONSE) + private String notificationResponse; + + public BalancePlatformNotificationResponse() { + } + + public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { + + this.notificationResponse = notificationResponse; + return this; + } + + /** + * Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @return notificationResponse + **/ + @ApiModelProperty(value = "Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).") + + public String getNotificationResponse() { + return notificationResponse; + } + + + public void setNotificationResponse(String notificationResponse) { + this.notificationResponse = notificationResponse; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalancePlatformNotificationResponse balancePlatformNotificationResponse = (BalancePlatformNotificationResponse) o; + return Objects.equals(this.notificationResponse, balancePlatformNotificationResponse.notificationResponse); + } + + @Override + public int hashCode() { + return Objects.hash(notificationResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalancePlatformNotificationResponse {\n"); + sb.append(" notificationResponse: ").append(toIndentedString(notificationResponse)).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("notificationResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalancePlatformNotificationResponse.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalancePlatformNotificationResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalancePlatformNotificationResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalancePlatformNotificationResponse is not found in the empty JSON string", BalancePlatformNotificationResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalancePlatformNotificationResponse.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalancePlatformNotificationResponse` properties.", entry.getKey())); + } + } + // validate the optional field notificationResponse + if (jsonObj.get("notificationResponse") != null && !jsonObj.get("notificationResponse").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `notificationResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationResponse").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalancePlatformNotificationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalancePlatformNotificationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalancePlatformNotificationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalancePlatformNotificationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalancePlatformNotificationResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalancePlatformNotificationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalancePlatformNotificationResponse + * @throws IOException if the JSON string is invalid with respect to BalancePlatformNotificationResponse + */ + public static BalancePlatformNotificationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalancePlatformNotificationResponse.class); + } + + /** + * Convert an instance of BalancePlatformNotificationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/reportwebhooks/JSON.java b/src/main/java/com/adyen/model/reportwebhooks/JSON.java new file mode 100644 index 000000000..7677f0882 --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/JSON.java @@ -0,0 +1,403 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +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.reportwebhooks.BalancePlatformNotificationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.reportwebhooks.ReportNotificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.reportwebhooks.ReportNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.reportwebhooks.Resource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.reportwebhooks.ResourceReference.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/reportwebhooks/ReportNotificationData.java b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java new file mode 100644 index 000000000..720f2e86c --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationData.java @@ -0,0 +1,420 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.reportwebhooks.ResourceReference; +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.reportwebhooks.JSON; + +/** + * ReportNotificationData + */ + +public class ReportNotificationData { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER = "accountHolder"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER) + private ResourceReference accountHolder; + + public static final String SERIALIZED_NAME_BALANCE_ACCOUNT = "balanceAccount"; + @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT) + private ResourceReference balanceAccount; + + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private OffsetDateTime creationDate; + + public static final String SERIALIZED_NAME_DOWNLOAD_URL = "downloadUrl"; + @SerializedName(SERIALIZED_NAME_DOWNLOAD_URL) + private String downloadUrl; + + public static final String SERIALIZED_NAME_FILE_NAME = "fileName"; + @SerializedName(SERIALIZED_NAME_FILE_NAME) + private String fileName; + + public static final String SERIALIZED_NAME_REPORT_TYPE = "reportType"; + @SerializedName(SERIALIZED_NAME_REPORT_TYPE) + private String reportType; + + public ReportNotificationData() { + } + + public ReportNotificationData 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 ReportNotificationData 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 ReportNotificationData balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public ReportNotificationData creationDate(OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.") + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public ReportNotificationData downloadUrl(String downloadUrl) { + + this.downloadUrl = downloadUrl; + return this; + } + + /** + * The URL at which you can download the report. To download, you must authenticate your GET request with your [API credentials](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview). + * @return downloadUrl + **/ + @ApiModelProperty(required = true, value = "The URL at which you can download the report. To download, you must authenticate your GET request with your [API credentials](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview).") + + public String getDownloadUrl() { + return downloadUrl; + } + + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + + public ReportNotificationData fileName(String fileName) { + + this.fileName = fileName; + return this; + } + + /** + * The filename of the report. + * @return fileName + **/ + @ApiModelProperty(required = true, value = "The filename of the report.") + + public String getFileName() { + return fileName; + } + + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + + public ReportNotificationData reportType(String reportType) { + + this.reportType = reportType; + return this; + } + + /** + * Type of report. + * @return reportType + **/ + @ApiModelProperty(required = true, value = "Type of report.") + + public String getReportType() { + return reportType; + } + + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReportNotificationData reportNotificationData = (ReportNotificationData) o; + return Objects.equals(this.accountHolder, reportNotificationData.accountHolder) && + Objects.equals(this.balanceAccount, reportNotificationData.balanceAccount) && + Objects.equals(this.balancePlatform, reportNotificationData.balancePlatform) && + Objects.equals(this.creationDate, reportNotificationData.creationDate) && + Objects.equals(this.downloadUrl, reportNotificationData.downloadUrl) && + Objects.equals(this.fileName, reportNotificationData.fileName) && + Objects.equals(this.reportType, reportNotificationData.reportType); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolder, balanceAccount, balancePlatform, creationDate, downloadUrl, fileName, reportType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportNotificationData {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\n"); + sb.append(" balanceAccount: ").append(toIndentedString(balanceAccount)).append("\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" downloadUrl: ").append(toIndentedString(downloadUrl)).append("\n"); + sb.append(" fileName: ").append(toIndentedString(fileName)).append("\n"); + sb.append(" reportType: ").append(toIndentedString(reportType)).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("accountHolder"); + openapiFields.add("balanceAccount"); + openapiFields.add("balancePlatform"); + openapiFields.add("creationDate"); + openapiFields.add("downloadUrl"); + openapiFields.add("fileName"); + openapiFields.add("reportType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("downloadUrl"); + openapiRequiredFields.add("fileName"); + openapiRequiredFields.add("reportType"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ReportNotificationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReportNotificationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReportNotificationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReportNotificationData is not found in the empty JSON string", ReportNotificationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReportNotificationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ReportNotificationData` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportNotificationData.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 `accountHolder` + if (jsonObj.getAsJsonObject("accountHolder") != null) { + ResourceReference.validateJsonObject(jsonObj.getAsJsonObject("accountHolder")); + } + // validate the optional field `balanceAccount` + if (jsonObj.getAsJsonObject("balanceAccount") != null) { + ResourceReference.validateJsonObject(jsonObj.getAsJsonObject("balanceAccount")); + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field downloadUrl + if (jsonObj.get("downloadUrl") != null && !jsonObj.get("downloadUrl").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `downloadUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("downloadUrl").toString())); + } + // validate the optional field fileName + if (jsonObj.get("fileName") != null && !jsonObj.get("fileName").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `fileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("fileName").toString())); + } + // validate the optional field reportType + if (jsonObj.get("reportType") != null && !jsonObj.get("reportType").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `reportType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reportType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ReportNotificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportNotificationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportNotificationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportNotificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReportNotificationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReportNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportNotificationData + * @throws IOException if the JSON string is invalid with respect to ReportNotificationData + */ + public static ReportNotificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportNotificationData.class); + } + + /** + * Convert an instance of ReportNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java new file mode 100644 index 000000000..86340f848 --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/ReportNotificationRequest.java @@ -0,0 +1,339 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.reportwebhooks.ReportNotificationData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.reportwebhooks.JSON; + +/** + * ReportNotificationRequest + */ + +public class ReportNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private ReportNotificationData data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * Type of notification. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BALANCEPLATFORM_REPORT_CREATED("balancePlatform.report.created"); + + 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 ReportNotificationRequest() { + } + + public ReportNotificationRequest data(ReportNotificationData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public ReportNotificationData getData() { + return data; + } + + + public void setData(ReportNotificationData data) { + this.data = data; + } + + + public ReportNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public ReportNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Type of notification. + * @return type + **/ + @ApiModelProperty(required = true, value = "Type of notification.") + + 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; + } + ReportNotificationRequest reportNotificationRequest = (ReportNotificationRequest) o; + return Objects.equals(this.data, reportNotificationRequest.data) && + Objects.equals(this.environment, reportNotificationRequest.environment) && + Objects.equals(this.type, reportNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReportNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ReportNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReportNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReportNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReportNotificationRequest is not found in the empty JSON string", ReportNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReportNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ReportNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReportNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + ReportNotificationData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!ReportNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReportNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReportNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ReportNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ReportNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReportNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReportNotificationRequest + * @throws IOException if the JSON string is invalid with respect to ReportNotificationRequest + */ + public static ReportNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReportNotificationRequest.class); + } + + /** + * Convert an instance of ReportNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/reportwebhooks/Resource.java b/src/main/java/com/adyen/model/reportwebhooks/Resource.java new file mode 100644 index 000000000..ac845d53b --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/Resource.java @@ -0,0 +1,277 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.reportwebhooks.JSON; + +/** + * Resource + */ + +public class Resource { + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private OffsetDateTime creationDate; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public Resource() { + } + + public Resource balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public Resource creationDate(OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.") + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public Resource id(String id) { + + this.id = id; + return this; + } + + /** + * The ID of the resource. + * @return id + **/ + @ApiModelProperty(value = "The ID of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Resource resource = (Resource) o; + return Objects.equals(this.balancePlatform, resource.balancePlatform) && + Objects.equals(this.creationDate, resource.creationDate) && + Objects.equals(this.id, resource.id); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, creationDate, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Resource {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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("balancePlatform"); + openapiFields.add("creationDate"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Resource.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Resource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Resource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Resource is not found in the empty JSON string", Resource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Resource.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Resource` properties.", entry.getKey())); + } + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Resource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Resource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Resource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Resource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Resource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Resource given an JSON string + * + * @param jsonString JSON string + * @return An instance of Resource + * @throws IOException if the JSON string is invalid with respect to Resource + */ + public static Resource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Resource.class); + } + + /** + * Convert an instance of Resource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java new file mode 100644 index 000000000..7ef651e0d --- /dev/null +++ b/src/main/java/com/adyen/model/reportwebhooks/ResourceReference.java @@ -0,0 +1,280 @@ +/* + * Report webhooks + * + * 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.reportwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.reportwebhooks.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(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResourceReference.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResourceReference` properties.", entry.getKey())); + } + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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/transferwebhooks/AULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java new file mode 100644 index 000000000..f546fc8c2 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/AULocalAccountIdentification.java @@ -0,0 +1,338 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AULocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AULocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/transferwebhooks/AbstractOpenApiSchema.java new file mode 100644 index 000000000..a56038c9f --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/AbstractOpenApiSchema.java @@ -0,0 +1,144 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +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/transferwebhooks/AdditionalBankIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java new file mode 100644 index 000000000..901438f6a --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/AdditionalBankIdentification.java @@ -0,0 +1,297 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AdditionalBankIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AdditionalBankIdentification` properties.", entry.getKey())); + } + } + // validate the optional field code + if (jsonObj.get("code") != null && !jsonObj.get("code").isJsonPrimitive()) { + log.log(Level.WARNING, 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/transferwebhooks/Address.java b/src/main/java/com/adyen/model/transferwebhooks/Address.java new file mode 100644 index 000000000..ec4c3b619 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/Address.java @@ -0,0 +1,387 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * Address + */ + +public class Address { + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_LINE1 = "line1"; + @SerializedName(SERIALIZED_NAME_LINE1) + private String line1; + + public static final String SERIALIZED_NAME_LINE2 = "line2"; + @SerializedName(SERIALIZED_NAME_LINE2) + private String line2; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + private String postalCode; + + public static final String SERIALIZED_NAME_STATE_OR_PROVINCE = "stateOrProvince"; + @SerializedName(SERIALIZED_NAME_STATE_OR_PROVINCE) + private String stateOrProvince; + + public Address() { + } + + public Address city(String city) { + + this.city = city; + return this; + } + + /** + * The name of the city. + * @return city + **/ + @ApiModelProperty(value = "The name of the city.") + + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + public Address country(String country) { + + this.country = country; + return this; + } + + /** + * 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**, **NL**, or **GB**.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public Address line1(String line1) { + + this.line1 = line1; + return this; + } + + /** + * First line of the street address. + * @return line1 + **/ + @ApiModelProperty(value = "First line of the street address.") + + public String getLine1() { + return line1; + } + + + public void setLine1(String line1) { + this.line1 = line1; + } + + + public Address line2(String line2) { + + this.line2 = line2; + return this; + } + + /** + * Second line of the street address. + * @return line2 + **/ + @ApiModelProperty(value = "Second line of the street address.") + + public String getLine2() { + return line2; + } + + + public void setLine2(String line2) { + this.line2 = line2; + } + + + public Address postalCode(String postalCode) { + + this.postalCode = postalCode; + return this; + } + + /** + * The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + * @return postalCode + **/ + @ApiModelProperty(value = "The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries.") + + public String getPostalCode() { + return postalCode; + } + + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + + public Address stateOrProvince(String stateOrProvince) { + + this.stateOrProvince = stateOrProvince; + return this; + } + + /** + * The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + * @return stateOrProvince + **/ + @ApiModelProperty(value = "The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada.") + + public String getStateOrProvince() { + return stateOrProvince; + } + + + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + } + + + + @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.country, address.country) && + Objects.equals(this.line1, address.line1) && + Objects.equals(this.line2, address.line2) && + Objects.equals(this.postalCode, address.postalCode) && + Objects.equals(this.stateOrProvince, address.stateOrProvince); + } + + @Override + public int hashCode() { + return Objects.hash(city, country, line1, line2, postalCode, stateOrProvince); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Address {\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"); + sb.append(" line2: ").append(toIndentedString(line2)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).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("country"); + openapiFields.add("line1"); + openapiFields.add("line2"); + openapiFields.add("postalCode"); + openapiFields.add("stateOrProvince"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("country"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Address.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Address.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Address` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Address.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 city + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonPrimitive()) { + log.log(Level.WARNING, 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 country + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonPrimitive()) { + log.log(Level.WARNING, 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 line1 + if (jsonObj.get("line1") != null && !jsonObj.get("line1").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `line1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line1").toString())); + } + // validate the optional field line2 + if (jsonObj.get("line2") != null && !jsonObj.get("line2").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `line2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("line2").toString())); + } + // validate the optional field postalCode + if (jsonObj.get("postalCode") != null && !jsonObj.get("postalCode").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `stateOrProvince` to be a primitive type in the JSON string but got `%s`", jsonObj.get("stateOrProvince").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/transferwebhooks/Amount.java b/src/main/java/com/adyen/model/transferwebhooks/Amount.java new file mode 100644 index 000000000..793209e28 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/Amount.java @@ -0,0 +1,252 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * Amount + */ + +public class Amount { + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + private Long value; + + public Amount() { + } + + public Amount currency(String currency) { + + this.currency = currency; + return this; + } + + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + * @return currency + **/ + @ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).") + + public String getCurrency() { + return currency; + } + + + public void setCurrency(String currency) { + this.currency = currency; + } + + + public Amount value(Long value) { + + this.value = value; + return this; + } + + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * @return value + **/ + @ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).") + + public Long getValue() { + return value; + } + + + public void setValue(Long value) { + this.value = value; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Amount amount = (Amount) o; + return Objects.equals(this.currency, amount.currency) && + Objects.equals(this.value, amount.value); + } + + @Override + public int hashCode() { + return Objects.hash(currency, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Amount {\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("currency"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("currency"); + openapiRequiredFields.add("value"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Amount.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Amount + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Amount.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Amount is not found in the empty JSON string", Amount.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Amount.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Amount` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Amount.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Amount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Amount' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Amount.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Amount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Amount read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Amount given an JSON string + * + * @param jsonString JSON string + * @return An instance of Amount + * @throws IOException if the JSON string is invalid with respect to Amount + */ + public static Amount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Amount.class); + } + + /** + * Convert an instance of Amount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java new file mode 100644 index 000000000..eb1cac680 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/AmountAdjustment.java @@ -0,0 +1,331 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.Amount; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * AmountAdjustment + */ + +public class AmountAdjustment { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + */ + @JsonAdapter(AmountAdjustmentTypeEnum.Adapter.class) + public enum AmountAdjustmentTypeEnum { + ATMMARKUP("atmMarkup"), + + AUTHHOLDRESERVE("authHoldReserve"), + + EXCHANGE("exchange"), + + FOREXMARKUP("forexMarkup"); + + private String value; + + AmountAdjustmentTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AmountAdjustmentTypeEnum fromValue(String value) { + for (AmountAdjustmentTypeEnum b : AmountAdjustmentTypeEnum.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 AmountAdjustmentTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AmountAdjustmentTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AmountAdjustmentTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_AMOUNT_ADJUSTMENT_TYPE = "amountAdjustmentType"; + @SerializedName(SERIALIZED_NAME_AMOUNT_ADJUSTMENT_TYPE) + private AmountAdjustmentTypeEnum amountAdjustmentType; + + public static final String SERIALIZED_NAME_BASEPOINTS = "basepoints"; + @SerializedName(SERIALIZED_NAME_BASEPOINTS) + private Integer basepoints; + + public AmountAdjustment() { + } + + public AmountAdjustment 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 AmountAdjustment amountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { + + this.amountAdjustmentType = amountAdjustmentType; + return this; + } + + /** + * The type of markup that is applied to an authorised payment. Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**. + * @return amountAdjustmentType + **/ + @ApiModelProperty(value = "The type of markup that is applied to an authorised payment. Possible values: **exchange**, **forexMarkup**, **authHoldReserve**, **atmMarkup**.") + + public AmountAdjustmentTypeEnum getAmountAdjustmentType() { + return amountAdjustmentType; + } + + + public void setAmountAdjustmentType(AmountAdjustmentTypeEnum amountAdjustmentType) { + this.amountAdjustmentType = amountAdjustmentType; + } + + + public AmountAdjustment basepoints(Integer basepoints) { + + this.basepoints = basepoints; + return this; + } + + /** + * The basepoints associated with the applied markup. + * @return basepoints + **/ + @ApiModelProperty(value = "The basepoints associated with the applied markup.") + + public Integer getBasepoints() { + return basepoints; + } + + + public void setBasepoints(Integer basepoints) { + this.basepoints = basepoints; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AmountAdjustment amountAdjustment = (AmountAdjustment) o; + return Objects.equals(this.amount, amountAdjustment.amount) && + Objects.equals(this.amountAdjustmentType, amountAdjustment.amountAdjustmentType) && + Objects.equals(this.basepoints, amountAdjustment.basepoints); + } + + @Override + public int hashCode() { + return Objects.hash(amount, amountAdjustmentType, basepoints); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AmountAdjustment {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" amountAdjustmentType: ").append(toIndentedString(amountAdjustmentType)).append("\n"); + sb.append(" basepoints: ").append(toIndentedString(basepoints)).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("amountAdjustmentType"); + openapiFields.add("basepoints"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(AmountAdjustment.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AmountAdjustment + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AmountAdjustment.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AmountAdjustment is not found in the empty JSON string", AmountAdjustment.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AmountAdjustment.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `AmountAdjustment` properties.", entry.getKey())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + // ensure the field amountAdjustmentType can be parsed to an enum value + if (jsonObj.get("amountAdjustmentType") != null) { + if(!jsonObj.get("amountAdjustmentType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `amountAdjustmentType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("amountAdjustmentType").toString())); + } + AmountAdjustmentTypeEnum.fromValue(jsonObj.get("amountAdjustmentType").getAsString()); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!AmountAdjustment.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AmountAdjustment' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AmountAdjustment.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, AmountAdjustment value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public AmountAdjustment read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AmountAdjustment given an JSON string + * + * @param jsonString JSON string + * @return An instance of AmountAdjustment + * @throws IOException if the JSON string is invalid with respect to AmountAdjustment + */ + public static AmountAdjustment fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AmountAdjustment.class); + } + + /** + * Convert an instance of AmountAdjustment to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java new file mode 100644 index 000000000..31c5da155 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/BRLocalAccountIdentification.java @@ -0,0 +1,372 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * BRLocalAccountIdentification + */ + +public class BRLocalAccountIdentification { + 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; + + public static final String SERIALIZED_NAME_BRANCH_NUMBER = "branchNumber"; + @SerializedName(SERIALIZED_NAME_BRANCH_NUMBER) + private String branchNumber; + + /** + * **brLocal** + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + BRLOCAL("brLocal"); + + 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.BRLOCAL; + + public BRLocalAccountIdentification() { + } + + public BRLocalAccountIdentification accountNumber(String accountNumber) { + + this.accountNumber = accountNumber; + return this; + } + + /** + * The bank account number (without separators or whitespace). + * @return accountNumber + **/ + @ApiModelProperty(required = true, value = "The bank account number (without separators or whitespace).") + + public String getAccountNumber() { + return accountNumber; + } + + + public void setAccountNumber(String accountNumber) { + this.accountNumber = accountNumber; + } + + + public BRLocalAccountIdentification bankCode(String bankCode) { + + this.bankCode = bankCode; + return this; + } + + /** + * The 3-digit Brazilian bank code (with leading zeros). + * @return bankCode + **/ + @ApiModelProperty(required = true, value = "The 3-digit Brazilian bank code (with leading zeros).") + + public String getBankCode() { + return bankCode; + } + + + public void setBankCode(String bankCode) { + this.bankCode = bankCode; + } + + + public BRLocalAccountIdentification branchNumber(String branchNumber) { + + this.branchNumber = branchNumber; + return this; + } + + /** + * The bank account branch number (without separators or whitespace). + * @return branchNumber + **/ + @ApiModelProperty(required = true, value = "The bank account branch number (without separators or whitespace).") + + public String getBranchNumber() { + return branchNumber; + } + + + public void setBranchNumber(String branchNumber) { + this.branchNumber = branchNumber; + } + + + public BRLocalAccountIdentification type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * **brLocal** + * @return type + **/ + @ApiModelProperty(required = true, value = "**brLocal**") + + 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; + } + BRLocalAccountIdentification brLocalAccountIdentification = (BRLocalAccountIdentification) o; + return Objects.equals(this.accountNumber, brLocalAccountIdentification.accountNumber) && + Objects.equals(this.bankCode, brLocalAccountIdentification.bankCode) && + Objects.equals(this.branchNumber, brLocalAccountIdentification.branchNumber) && + Objects.equals(this.type, brLocalAccountIdentification.type); + } + + @Override + public int hashCode() { + return Objects.hash(accountNumber, bankCode, branchNumber, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BRLocalAccountIdentification {\n"); + sb.append(" accountNumber: ").append(toIndentedString(accountNumber)).append("\n"); + sb.append(" bankCode: ").append(toIndentedString(bankCode)).append("\n"); + sb.append(" branchNumber: ").append(toIndentedString(branchNumber)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + 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("branchNumber"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountNumber"); + openapiRequiredFields.add("bankCode"); + openapiRequiredFields.add("branchNumber"); + openapiRequiredFields.add("type"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BRLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BRLocalAccountIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BRLocalAccountIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BRLocalAccountIdentification is not found in the empty JSON string", BRLocalAccountIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BRLocalAccountIdentification.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BRLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BRLocalAccountIdentification.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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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 branchNumber + if (jsonObj.get("branchNumber") != null && !jsonObj.get("branchNumber").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `branchNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("branchNumber").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 (!BRLocalAccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BRLocalAccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BRLocalAccountIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BRLocalAccountIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BRLocalAccountIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BRLocalAccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of BRLocalAccountIdentification + * @throws IOException if the JSON string is invalid with respect to BRLocalAccountIdentification + */ + public static BRLocalAccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BRLocalAccountIdentification.class); + } + + /** + * Convert an instance of BRLocalAccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java new file mode 100644 index 000000000..728a6bad5 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/BalanceMutation.java @@ -0,0 +1,301 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * BalanceMutation + */ + +public class BalanceMutation { + public static final String SERIALIZED_NAME_BALANCE = "balance"; + @SerializedName(SERIALIZED_NAME_BALANCE) + private Long balance; + + public static final String SERIALIZED_NAME_CURRENCY = "currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + private String currency; + + public static final String SERIALIZED_NAME_RECEIVED = "received"; + @SerializedName(SERIALIZED_NAME_RECEIVED) + private Long received; + + public static final String SERIALIZED_NAME_RESERVED = "reserved"; + @SerializedName(SERIALIZED_NAME_RESERVED) + private Long reserved; + + public BalanceMutation() { + } + + public BalanceMutation balance(Long balance) { + + this.balance = balance; + return this; + } + + /** + * The amount in the payment's currency that is debited or credited on the balance accounting register. + * @return balance + **/ + @ApiModelProperty(value = "The amount in the payment's currency that is debited or credited on the balance accounting register.") + + public Long getBalance() { + return balance; + } + + + public void setBalance(Long balance) { + this.balance = balance; + } + + + public BalanceMutation 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(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 BalanceMutation received(Long received) { + + this.received = received; + return this; + } + + /** + * The amount in the payment's currency that is debited or credited on the received accounting register. + * @return received + **/ + @ApiModelProperty(value = "The amount in the payment's currency that is debited or credited on the received accounting register.") + + public Long getReceived() { + return received; + } + + + public void setReceived(Long received) { + this.received = received; + } + + + public BalanceMutation reserved(Long reserved) { + + this.reserved = reserved; + return this; + } + + /** + * The amount in the payment's currency that is debited or credited on the reserved accounting register. + * @return reserved + **/ + @ApiModelProperty(value = "The amount in the payment's currency that is debited or credited on the reserved accounting register.") + + public Long getReserved() { + return reserved; + } + + + public void setReserved(Long reserved) { + this.reserved = reserved; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalanceMutation balanceMutation = (BalanceMutation) o; + return Objects.equals(this.balance, balanceMutation.balance) && + Objects.equals(this.currency, balanceMutation.currency) && + Objects.equals(this.received, balanceMutation.received) && + Objects.equals(this.reserved, balanceMutation.reserved); + } + + @Override + public int hashCode() { + return Objects.hash(balance, currency, received, reserved); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalanceMutation {\n"); + sb.append(" balance: ").append(toIndentedString(balance)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" received: ").append(toIndentedString(received)).append("\n"); + sb.append(" reserved: ").append(toIndentedString(reserved)).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("balance"); + openapiFields.add("currency"); + openapiFields.add("received"); + openapiFields.add("reserved"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalanceMutation.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalanceMutation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalanceMutation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalanceMutation is not found in the empty JSON string", BalanceMutation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalanceMutation.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalanceMutation` properties.", entry.getKey())); + } + } + // validate the optional field currency + if (jsonObj.get("currency") != null && !jsonObj.get("currency").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("currency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalanceMutation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalanceMutation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalanceMutation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalanceMutation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalanceMutation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalanceMutation given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalanceMutation + * @throws IOException if the JSON string is invalid with respect to BalanceMutation + */ + public static BalanceMutation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalanceMutation.class); + } + + /** + * Convert an instance of BalanceMutation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java new file mode 100644 index 000000000..937b03b5f --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/BalancePlatformNotificationResponse.java @@ -0,0 +1,214 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * BalancePlatformNotificationResponse + */ + +public class BalancePlatformNotificationResponse { + public static final String SERIALIZED_NAME_NOTIFICATION_RESPONSE = "notificationResponse"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_RESPONSE) + private String notificationResponse; + + public BalancePlatformNotificationResponse() { + } + + public BalancePlatformNotificationResponse notificationResponse(String notificationResponse) { + + this.notificationResponse = notificationResponse; + return this; + } + + /** + * Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications). + * @return notificationResponse + **/ + @ApiModelProperty(value = "Respond with **HTTP 200 OK** and `[accepted]` in the response body to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).") + + public String getNotificationResponse() { + return notificationResponse; + } + + + public void setNotificationResponse(String notificationResponse) { + this.notificationResponse = notificationResponse; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BalancePlatformNotificationResponse balancePlatformNotificationResponse = (BalancePlatformNotificationResponse) o; + return Objects.equals(this.notificationResponse, balancePlatformNotificationResponse.notificationResponse); + } + + @Override + public int hashCode() { + return Objects.hash(notificationResponse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BalancePlatformNotificationResponse {\n"); + sb.append(" notificationResponse: ").append(toIndentedString(notificationResponse)).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("notificationResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BalancePlatformNotificationResponse.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BalancePlatformNotificationResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BalancePlatformNotificationResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BalancePlatformNotificationResponse is not found in the empty JSON string", BalancePlatformNotificationResponse.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BalancePlatformNotificationResponse.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BalancePlatformNotificationResponse` properties.", entry.getKey())); + } + } + // validate the optional field notificationResponse + if (jsonObj.get("notificationResponse") != null && !jsonObj.get("notificationResponse").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `notificationResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("notificationResponse").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BalancePlatformNotificationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BalancePlatformNotificationResponse' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BalancePlatformNotificationResponse.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BalancePlatformNotificationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BalancePlatformNotificationResponse read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BalancePlatformNotificationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BalancePlatformNotificationResponse + * @throws IOException if the JSON string is invalid with respect to BalancePlatformNotificationResponse + */ + public static BalancePlatformNotificationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BalancePlatformNotificationResponse.class); + } + + /** + * Convert an instance of BalancePlatformNotificationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java new file mode 100644 index 000000000..cadc33c21 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3.java @@ -0,0 +1,258 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.BankAccountV3AccountIdentification; +import com.adyen.model.transferwebhooks.PartyIdentification; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * BankAccountV3 + */ + +public class BankAccountV3 { + public static final String SERIALIZED_NAME_ACCOUNT_HOLDER = "accountHolder"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_HOLDER) + private PartyIdentification accountHolder; + + public static final String SERIALIZED_NAME_ACCOUNT_IDENTIFICATION = "accountIdentification"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_IDENTIFICATION) + private BankAccountV3AccountIdentification accountIdentification; + + public BankAccountV3() { + } + + public BankAccountV3 accountHolder(PartyIdentification accountHolder) { + + this.accountHolder = accountHolder; + return this; + } + + /** + * Get accountHolder + * @return accountHolder + **/ + @ApiModelProperty(required = true, value = "") + + public PartyIdentification getAccountHolder() { + return accountHolder; + } + + + public void setAccountHolder(PartyIdentification accountHolder) { + this.accountHolder = accountHolder; + } + + + public BankAccountV3 accountIdentification(BankAccountV3AccountIdentification accountIdentification) { + + this.accountIdentification = accountIdentification; + return this; + } + + /** + * Get accountIdentification + * @return accountIdentification + **/ + @ApiModelProperty(required = true, value = "") + + public BankAccountV3AccountIdentification getAccountIdentification() { + return accountIdentification; + } + + + public void setAccountIdentification(BankAccountV3AccountIdentification accountIdentification) { + this.accountIdentification = accountIdentification; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BankAccountV3 bankAccountV3 = (BankAccountV3) o; + return Objects.equals(this.accountHolder, bankAccountV3.accountHolder) && + Objects.equals(this.accountIdentification, bankAccountV3.accountIdentification); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolder, accountIdentification); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BankAccountV3 {\n"); + sb.append(" accountHolder: ").append(toIndentedString(accountHolder)).append("\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("accountHolder"); + openapiFields.add("accountIdentification"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("accountHolder"); + openapiRequiredFields.add("accountIdentification"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(BankAccountV3.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BankAccountV3 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BankAccountV3.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BankAccountV3 is not found in the empty JSON string", BankAccountV3.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BankAccountV3.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `BankAccountV3` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BankAccountV3.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 `accountHolder` + if (jsonObj.getAsJsonObject("accountHolder") != null) { + PartyIdentification.validateJsonObject(jsonObj.getAsJsonObject("accountHolder")); + } + // validate the optional field `accountIdentification` + if (jsonObj.getAsJsonObject("accountIdentification") != null) { + BankAccountV3AccountIdentification.validateJsonObject(jsonObj.getAsJsonObject("accountIdentification")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BankAccountV3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BankAccountV3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BankAccountV3.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, BankAccountV3 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public BankAccountV3 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BankAccountV3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountV3 + * @throws IOException if the JSON string is invalid with respect to BankAccountV3 + */ + public static BankAccountV3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BankAccountV3.class); + } + + /** + * Convert an instance of BankAccountV3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java new file mode 100644 index 000000000..c5ca67082 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/BankAccountV3AccountIdentification.java @@ -0,0 +1,936 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.AULocalAccountIdentification; +import com.adyen.model.transferwebhooks.AdditionalBankIdentification; +import com.adyen.model.transferwebhooks.BRLocalAccountIdentification; +import com.adyen.model.transferwebhooks.CALocalAccountIdentification; +import com.adyen.model.transferwebhooks.CZLocalAccountIdentification; +import com.adyen.model.transferwebhooks.DKLocalAccountIdentification; +import com.adyen.model.transferwebhooks.HULocalAccountIdentification; +import com.adyen.model.transferwebhooks.IbanAccountIdentification; +import com.adyen.model.transferwebhooks.NOLocalAccountIdentification; +import com.adyen.model.transferwebhooks.NumberAndBicAccountIdentification; +import com.adyen.model.transferwebhooks.PLLocalAccountIdentification; +import com.adyen.model.transferwebhooks.SELocalAccountIdentification; +import com.adyen.model.transferwebhooks.SGLocalAccountIdentification; +import com.adyen.model.transferwebhooks.UKLocalAccountIdentification; +import com.adyen.model.transferwebhooks.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.transferwebhooks.JSON; + + +public class BankAccountV3AccountIdentification extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(BankAccountV3AccountIdentification.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!BankAccountV3AccountIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BankAccountV3AccountIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter adapterAULocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(AULocalAccountIdentification.class)); + final TypeAdapter adapterBRLocalAccountIdentification = gson.getDelegateAdapter(this, TypeToken.get(BRLocalAccountIdentification.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 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, BankAccountV3AccountIdentification 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 `BRLocalAccountIdentification` + if (value.getActualInstance() instanceof BRLocalAccountIdentification) { + JsonObject obj = adapterBRLocalAccountIdentification.toJsonTree((BRLocalAccountIdentification)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 `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, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + } + + @Override + public BankAccountV3AccountIdentification 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 BRLocalAccountIdentification + try { + // validate the JSON object to see if any exception is thrown + BRLocalAccountIdentification.validateJsonObject(jsonObject); + actualAdapter = adapterBRLocalAccountIdentification; + match++; + log.log(Level.FINER, "Input data matches schema 'BRLocalAccountIdentification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BRLocalAccountIdentification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BRLocalAccountIdentification'", 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 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) { + BankAccountV3AccountIdentification ret = new BankAccountV3AccountIdentification(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for BankAccountV3AccountIdentification: %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 BankAccountV3AccountIdentification() { + super("oneOf", Boolean.FALSE); + } + + public BankAccountV3AccountIdentification(AULocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(BRLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(CALocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(CZLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(DKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(HULocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(IbanAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(NOLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(NumberAndBicAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(PLLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(SELocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(SGLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(UKLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public BankAccountV3AccountIdentification(USLocalAccountIdentification o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AULocalAccountIdentification", new GenericType() { + }); + schemas.put("BRLocalAccountIdentification", new GenericType() { + }); + schemas.put("CALocalAccountIdentification", new GenericType() { + }); + schemas.put("CZLocalAccountIdentification", new GenericType() { + }); + schemas.put("DKLocalAccountIdentification", new GenericType() { + }); + schemas.put("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 BankAccountV3AccountIdentification.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, 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 BRLocalAccountIdentification) { + 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 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, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification"); + } + + /** + * Get the actual instance, which can be the following: + * AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, HULocalAccountIdentification, IbanAccountIdentification, NOLocalAccountIdentification, NumberAndBicAccountIdentification, PLLocalAccountIdentification, SELocalAccountIdentification, SGLocalAccountIdentification, UKLocalAccountIdentification, USLocalAccountIdentification + * + * @return The actual instance (AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, 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 `BRLocalAccountIdentification`. If the actual instance is not `BRLocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BRLocalAccountIdentification` + * @throws ClassCastException if the instance is not `BRLocalAccountIdentification` + */ + public BRLocalAccountIdentification getBRLocalAccountIdentification() throws ClassCastException { + return (BRLocalAccountIdentification)super.getActualInstance(); + } + + /** + * Get the actual instance of `CALocalAccountIdentification`. If the actual instance is not `CALocalAccountIdentification`, + * the ClassCastException will be thrown. + * + * @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 `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 BankAccountV3AccountIdentification + */ + 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 { + Logger.getLogger(AULocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 BRLocalAccountIdentification + try { + Logger.getLogger(BRLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + BRLocalAccountIdentification.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BRLocalAccountIdentification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with CALocalAccountIdentification + try { + Logger.getLogger(CALocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(CZLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(DKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(HULocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(IbanAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(NOLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(NumberAndBicAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(PLLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(SELocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(SGLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(UKLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 { + Logger.getLogger(USLocalAccountIdentification.class.getName()).setLevel(Level.OFF); + 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 BankAccountV3AccountIdentification with oneOf schemas: AULocalAccountIdentification, BRLocalAccountIdentification, CALocalAccountIdentification, CZLocalAccountIdentification, DKLocalAccountIdentification, 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 BankAccountV3AccountIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of BankAccountV3AccountIdentification + * @throws IOException if the JSON string is invalid with respect to BankAccountV3AccountIdentification + */ + public static BankAccountV3AccountIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BankAccountV3AccountIdentification.class); + } + + /** + * Convert an instance of BankAccountV3AccountIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java new file mode 100644 index 000000000..183d5e364 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/CALocalAccountIdentification.java @@ -0,0 +1,455 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CALocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CALocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/CZLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java new file mode 100644 index 000000000..f58ef2708 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/CZLocalAccountIdentification.java @@ -0,0 +1,338 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CZLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CZLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/CounterpartyV3.java b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java new file mode 100644 index 000000000..5fe0351f5 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/CounterpartyV3.java @@ -0,0 +1,315 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.BankAccountV3; +import com.adyen.model.transferwebhooks.MerchantData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * CounterpartyV3 + */ + +public class CounterpartyV3 { + 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 BankAccountV3 bankAccount; + + public static final String SERIALIZED_NAME_MERCHANT = "merchant"; + @SerializedName(SERIALIZED_NAME_MERCHANT) + private MerchantData merchant; + + public static final String SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; + @SerializedName(SERIALIZED_NAME_TRANSFER_INSTRUMENT_ID) + private String transferInstrumentId; + + public CounterpartyV3() { + } + + public CounterpartyV3 balanceAccountId(String balanceAccountId) { + + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). + * @return balanceAccountId + **/ + @ApiModelProperty(value = "Unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id).") + + public String getBalanceAccountId() { + return balanceAccountId; + } + + + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public CounterpartyV3 bankAccount(BankAccountV3 bankAccount) { + + this.bankAccount = bankAccount; + return this; + } + + /** + * Get bankAccount + * @return bankAccount + **/ + @ApiModelProperty(value = "") + + public BankAccountV3 getBankAccount() { + return bankAccount; + } + + + public void setBankAccount(BankAccountV3 bankAccount) { + this.bankAccount = bankAccount; + } + + + public CounterpartyV3 merchant(MerchantData merchant) { + + this.merchant = merchant; + return this; + } + + /** + * Get merchant + * @return merchant + **/ + @ApiModelProperty(value = "") + + public MerchantData getMerchant() { + return merchant; + } + + + public void setMerchant(MerchantData merchant) { + this.merchant = merchant; + } + + + public CounterpartyV3 transferInstrumentId(String transferInstrumentId) { + + this.transferInstrumentId = transferInstrumentId; + return this; + } + + /** + * Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id). + * @return transferInstrumentId + **/ + @ApiModelProperty(value = "Unique identifier of the [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id).") + + 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; + } + CounterpartyV3 counterpartyV3 = (CounterpartyV3) o; + return Objects.equals(this.balanceAccountId, counterpartyV3.balanceAccountId) && + Objects.equals(this.bankAccount, counterpartyV3.bankAccount) && + Objects.equals(this.merchant, counterpartyV3.merchant) && + Objects.equals(this.transferInstrumentId, counterpartyV3.transferInstrumentId); + } + + @Override + public int hashCode() { + return Objects.hash(balanceAccountId, bankAccount, merchant, transferInstrumentId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CounterpartyV3 {\n"); + sb.append(" balanceAccountId: ").append(toIndentedString(balanceAccountId)).append("\n"); + sb.append(" bankAccount: ").append(toIndentedString(bankAccount)).append("\n"); + sb.append(" merchant: ").append(toIndentedString(merchant)).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("balanceAccountId"); + openapiFields.add("bankAccount"); + openapiFields.add("merchant"); + openapiFields.add("transferInstrumentId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(CounterpartyV3.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CounterpartyV3 + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CounterpartyV3.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CounterpartyV3 is not found in the empty JSON string", CounterpartyV3.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CounterpartyV3.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `CounterpartyV3` properties.", entry.getKey())); + } + } + // validate the optional field balanceAccountId + if (jsonObj.get("balanceAccountId") != null && !jsonObj.get("balanceAccountId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field `bankAccount` + if (jsonObj.getAsJsonObject("bankAccount") != null) { + BankAccountV3.validateJsonObject(jsonObj.getAsJsonObject("bankAccount")); + } + // validate the optional field `merchant` + if (jsonObj.getAsJsonObject("merchant") != null) { + MerchantData.validateJsonObject(jsonObj.getAsJsonObject("merchant")); + } + // validate the optional field transferInstrumentId + if (jsonObj.get("transferInstrumentId") != null && !jsonObj.get("transferInstrumentId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `transferInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transferInstrumentId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!CounterpartyV3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CounterpartyV3' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CounterpartyV3.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, CounterpartyV3 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public CounterpartyV3 read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CounterpartyV3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of CounterpartyV3 + * @throws IOException if the JSON string is invalid with respect to CounterpartyV3 + */ + public static CounterpartyV3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CounterpartyV3.class); + } + + /** + * Convert an instance of CounterpartyV3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java new file mode 100644 index 000000000..6154632f7 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/DKLocalAccountIdentification.java @@ -0,0 +1,338 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(DKLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `DKLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/HULocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java new file mode 100644 index 000000000..eda212378 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/HULocalAccountIdentification.java @@ -0,0 +1,304 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(HULocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `HULocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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/transferwebhooks/IbanAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java new file mode 100644 index 000000000..f01ea4377 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/IbanAccountIdentification.java @@ -0,0 +1,304 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(IbanAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `IbanAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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/transferwebhooks/JSON.java b/src/main/java/com/adyen/model/transferwebhooks/JSON.java new file mode 100644 index 000000000..bffb3df78 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/JSON.java @@ -0,0 +1,437 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +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.transferwebhooks.AULocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.AdditionalBankIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.Address.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.Amount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.AmountAdjustment.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.BRLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.BalanceMutation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.BalancePlatformNotificationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.BankAccountV3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.BankAccountV3AccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.CALocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.CZLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.CounterpartyV3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.DKLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.HULocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.IbanAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.MerchantData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.NOLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.NameLocation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.NumberAndBicAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.PLLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.PartyIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.PaymentInstrument.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.RelayedAuthorisationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.Resource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.ResourceReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.SELocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.SGLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransactionEventViolation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransactionRuleReference.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransactionRuleSource.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransactionRulesResult.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransferEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransferNotificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransferNotificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransferNotificationTransferTracking.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.TransferNotificationValidationFact.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.UKLocalAccountIdentification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.adyen.model.transferwebhooks.USLocalAccountIdentification.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/transferwebhooks/MerchantData.java b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java new file mode 100644 index 000000000..b18935918 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/MerchantData.java @@ -0,0 +1,314 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.NameLocation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * MerchantData + */ + +public class MerchantData { + public static final String SERIALIZED_NAME_MCC = "mcc"; + @SerializedName(SERIALIZED_NAME_MCC) + private String mcc; + + public static final String SERIALIZED_NAME_MERCHANT_ID = "merchantId"; + @SerializedName(SERIALIZED_NAME_MERCHANT_ID) + private String merchantId; + + public static final String SERIALIZED_NAME_NAME_LOCATION = "nameLocation"; + @SerializedName(SERIALIZED_NAME_NAME_LOCATION) + private NameLocation nameLocation; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "postalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + private String postalCode; + + public MerchantData() { + } + + public MerchantData mcc(String mcc) { + + this.mcc = mcc; + return this; + } + + /** + * The merchant category code. + * @return mcc + **/ + @ApiModelProperty(value = "The merchant category code.") + + public String getMcc() { + return mcc; + } + + + public void setMcc(String mcc) { + this.mcc = mcc; + } + + + public MerchantData merchantId(String merchantId) { + + this.merchantId = merchantId; + return this; + } + + /** + * The merchant identifier. + * @return merchantId + **/ + @ApiModelProperty(value = "The merchant identifier.") + + public String getMerchantId() { + return merchantId; + } + + + public void setMerchantId(String merchantId) { + this.merchantId = merchantId; + } + + + public MerchantData nameLocation(NameLocation nameLocation) { + + this.nameLocation = nameLocation; + return this; + } + + /** + * Get nameLocation + * @return nameLocation + **/ + @ApiModelProperty(value = "") + + public NameLocation getNameLocation() { + return nameLocation; + } + + + public void setNameLocation(NameLocation nameLocation) { + this.nameLocation = nameLocation; + } + + + public MerchantData postalCode(String postalCode) { + + this.postalCode = postalCode; + return this; + } + + /** + * The merchant postal code. + * @return postalCode + **/ + @ApiModelProperty(value = "The merchant postal code.") + + public String getPostalCode() { + return postalCode; + } + + + 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; + } + MerchantData merchantData = (MerchantData) o; + return Objects.equals(this.mcc, merchantData.mcc) && + Objects.equals(this.merchantId, merchantData.merchantId) && + Objects.equals(this.nameLocation, merchantData.nameLocation) && + Objects.equals(this.postalCode, merchantData.postalCode); + } + + @Override + public int hashCode() { + return Objects.hash(mcc, merchantId, nameLocation, postalCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MerchantData {\n"); + sb.append(" mcc: ").append(toIndentedString(mcc)).append("\n"); + sb.append(" merchantId: ").append(toIndentedString(merchantId)).append("\n"); + sb.append(" nameLocation: ").append(toIndentedString(nameLocation)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).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("mcc"); + openapiFields.add("merchantId"); + openapiFields.add("nameLocation"); + openapiFields.add("postalCode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(MerchantData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MerchantData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MerchantData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MerchantData is not found in the empty JSON string", MerchantData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MerchantData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `MerchantData` properties.", entry.getKey())); + } + } + // validate the optional field mcc + if (jsonObj.get("mcc") != null && !jsonObj.get("mcc").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `mcc` to be a primitive type in the JSON string but got `%s`", jsonObj.get("mcc").toString())); + } + // validate the optional field merchantId + if (jsonObj.get("merchantId") != null && !jsonObj.get("merchantId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `merchantId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("merchantId").toString())); + } + // validate the optional field `nameLocation` + if (jsonObj.getAsJsonObject("nameLocation") != null) { + NameLocation.validateJsonObject(jsonObj.getAsJsonObject("nameLocation")); + } + // validate the optional field postalCode + if (jsonObj.get("postalCode") != null && !jsonObj.get("postalCode").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `postalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("postalCode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!MerchantData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MerchantData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MerchantData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, MerchantData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public MerchantData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MerchantData given an JSON string + * + * @param jsonString JSON string + * @return An instance of MerchantData + * @throws IOException if the JSON string is invalid with respect to MerchantData + */ + public static MerchantData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MerchantData.class); + } + + /** + * Convert an instance of MerchantData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java new file mode 100644 index 000000000..038db3ec8 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/NOLocalAccountIdentification.java @@ -0,0 +1,304 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NOLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NOLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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/transferwebhooks/NameLocation.java b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java new file mode 100644 index 000000000..0e1c29235 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/NameLocation.java @@ -0,0 +1,379 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * NameLocation + */ + +public class NameLocation { + public static final String SERIALIZED_NAME_CITY = "city"; + @SerializedName(SERIALIZED_NAME_CITY) + private String city; + + public static final String SERIALIZED_NAME_COUNTRY = "country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + private String country; + + public static final String SERIALIZED_NAME_COUNTRY_OF_ORIGIN = "countryOfOrigin"; + @SerializedName(SERIALIZED_NAME_COUNTRY_OF_ORIGIN) + private String countryOfOrigin; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_RAW_DATA = "rawData"; + @SerializedName(SERIALIZED_NAME_RAW_DATA) + private String rawData; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + private String state; + + public NameLocation() { + } + + public NameLocation city(String city) { + + this.city = city; + return this; + } + + /** + * The city where the merchant is located. + * @return city + **/ + @ApiModelProperty(value = "The city where the merchant is located.") + + public String getCity() { + return city; + } + + + public void setCity(String city) { + this.city = city; + } + + + public NameLocation country(String country) { + + this.country = country; + return this; + } + + /** + * The country where the merchant is located in [three-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * @return country + **/ + @ApiModelProperty(value = "The country where the merchant is located in [three-letter country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.") + + public String getCountry() { + return country; + } + + + public void setCountry(String country) { + this.country = country; + } + + + public NameLocation countryOfOrigin(String countryOfOrigin) { + + this.countryOfOrigin = countryOfOrigin; + return this; + } + + /** + * The home country in [three-digit country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled merchants such as embassies. + * @return countryOfOrigin + **/ + @ApiModelProperty(value = "The home country in [three-digit country code](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) format, used for government-controlled merchants such as embassies.") + + public String getCountryOfOrigin() { + return countryOfOrigin; + } + + + public void setCountryOfOrigin(String countryOfOrigin) { + this.countryOfOrigin = countryOfOrigin; + } + + + public NameLocation name(String name) { + + this.name = name; + return this; + } + + /** + * The name of the merchant's shop or service. + * @return name + **/ + @ApiModelProperty(value = "The name of the merchant's shop or service.") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public NameLocation rawData(String rawData) { + + this.rawData = rawData; + return this; + } + + /** + * The raw data. + * @return rawData + **/ + @ApiModelProperty(value = "The raw data.") + + public String getRawData() { + return rawData; + } + + + public void setRawData(String rawData) { + this.rawData = rawData; + } + + + public NameLocation state(String state) { + + this.state = state; + return this; + } + + /** + * The state where the merchant is located. + * @return state + **/ + @ApiModelProperty(value = "The state where the merchant is located.") + + public String getState() { + return state; + } + + + public void setState(String state) { + this.state = state; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameLocation nameLocation = (NameLocation) o; + return Objects.equals(this.city, nameLocation.city) && + Objects.equals(this.country, nameLocation.country) && + Objects.equals(this.countryOfOrigin, nameLocation.countryOfOrigin) && + Objects.equals(this.name, nameLocation.name) && + Objects.equals(this.rawData, nameLocation.rawData) && + Objects.equals(this.state, nameLocation.state); + } + + @Override + public int hashCode() { + return Objects.hash(city, country, countryOfOrigin, name, rawData, state); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameLocation {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" countryOfOrigin: ").append(toIndentedString(countryOfOrigin)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rawData: ").append(toIndentedString(rawData)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).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("country"); + openapiFields.add("countryOfOrigin"); + openapiFields.add("name"); + openapiFields.add("rawData"); + openapiFields.add("state"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NameLocation.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NameLocation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NameLocation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NameLocation is not found in the empty JSON string", NameLocation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NameLocation.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NameLocation` properties.", entry.getKey())); + } + } + // validate the optional field city + if (jsonObj.get("city") != null && !jsonObj.get("city").isJsonPrimitive()) { + log.log(Level.WARNING, 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 country + if (jsonObj.get("country") != null && !jsonObj.get("country").isJsonPrimitive()) { + log.log(Level.WARNING, 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 countryOfOrigin + if (jsonObj.get("countryOfOrigin") != null && !jsonObj.get("countryOfOrigin").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `countryOfOrigin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("countryOfOrigin").toString())); + } + // validate the optional field name + if (jsonObj.get("name") != null && !jsonObj.get("name").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString())); + } + // validate the optional field rawData + if (jsonObj.get("rawData") != null && !jsonObj.get("rawData").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `rawData` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawData").toString())); + } + // validate the optional field state + if (jsonObj.get("state") != null && !jsonObj.get("state").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!NameLocation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'NameLocation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(NameLocation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, NameLocation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public NameLocation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of NameLocation given an JSON string + * + * @param jsonString JSON string + * @return An instance of NameLocation + * @throws IOException if the JSON string is invalid with respect to NameLocation + */ + public static NameLocation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NameLocation.class); + } + + /** + * Convert an instance of NameLocation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java new file mode 100644 index 000000000..1646de479 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/NumberAndBicAccountIdentification.java @@ -0,0 +1,372 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(NumberAndBicAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `NumberAndBicAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/PLLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java new file mode 100644 index 000000000..6562af05e --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/PLLocalAccountIdentification.java @@ -0,0 +1,304 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PLLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PLLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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/transferwebhooks/PartyIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java new file mode 100644 index 000000000..fcac500b9 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/PartyIdentification.java @@ -0,0 +1,470 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.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.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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * PartyIdentification + */ + +public class PartyIdentification { + public static final String SERIALIZED_NAME_ADDRESS = "address"; + @SerializedName(SERIALIZED_NAME_ADDRESS) + private Address 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 PartyIdentification() { + } + + public PartyIdentification address(Address address) { + + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @ApiModelProperty(value = "") + + public Address getAddress() { + return address; + } + + + public void setAddress(Address address) { + this.address = address; + } + + + public PartyIdentification 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 PartyIdentification 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 PartyIdentification 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 PartyIdentification 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 PartyIdentification 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 PartyIdentification 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; + } + PartyIdentification partyIdentification = (PartyIdentification) o; + return Objects.equals(this.address, partyIdentification.address) && + Objects.equals(this.dateOfBirth, partyIdentification.dateOfBirth) && + Objects.equals(this.firstName, partyIdentification.firstName) && + Objects.equals(this.fullName, partyIdentification.fullName) && + Objects.equals(this.lastName, partyIdentification.lastName) && + Objects.equals(this.reference, partyIdentification.reference) && + Objects.equals(this.type, partyIdentification.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 PartyIdentification {\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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PartyIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PartyIdentification + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PartyIdentification.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PartyIdentification is not found in the empty JSON string", PartyIdentification.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PartyIdentification.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PartyIdentification` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PartyIdentification.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 firstName + if (jsonObj.get("firstName") != null && !jsonObj.get("firstName").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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 (!PartyIdentification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PartyIdentification' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PartyIdentification.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PartyIdentification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PartyIdentification read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PartyIdentification given an JSON string + * + * @param jsonString JSON string + * @return An instance of PartyIdentification + * @throws IOException if the JSON string is invalid with respect to PartyIdentification + */ + public static PartyIdentification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PartyIdentification.class); + } + + /** + * Convert an instance of PartyIdentification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java new file mode 100644 index 000000000..36c0ac5df --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/PaymentInstrument.java @@ -0,0 +1,313 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(PaymentInstrument.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `PaymentInstrument` properties.", entry.getKey())); + } + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/RelayedAuthorisationData.java b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java new file mode 100644 index 000000000..1468550da --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/RelayedAuthorisationData.java @@ -0,0 +1,254 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * RelayedAuthorisationData + */ + +public class RelayedAuthorisationData { + public static final String SERIALIZED_NAME_METADATA = "metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + private Map metadata = null; + + public static final String SERIALIZED_NAME_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + public RelayedAuthorisationData() { + } + + public RelayedAuthorisationData metadata(Map metadata) { + + this.metadata = metadata; + return this; + } + + public RelayedAuthorisationData putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Contains key-value pairs of your references and descriptions, for example, `customId`:`your-own-custom-field-12345`. + * @return metadata + **/ + @ApiModelProperty(value = "Contains key-value pairs of your references and descriptions, for example, `customId`:`your-own-custom-field-12345`.") + + public Map getMetadata() { + return metadata; + } + + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + + public RelayedAuthorisationData reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your reference for the relayed authorisation data. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the relayed authorisation data.") + + 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; + } + RelayedAuthorisationData relayedAuthorisationData = (RelayedAuthorisationData) o; + return Objects.equals(this.metadata, relayedAuthorisationData.metadata) && + Objects.equals(this.reference, relayedAuthorisationData.reference); + } + + @Override + public int hashCode() { + return Objects.hash(metadata, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelayedAuthorisationData {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).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("metadata"); + openapiFields.add("reference"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(RelayedAuthorisationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to RelayedAuthorisationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (RelayedAuthorisationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in RelayedAuthorisationData is not found in the empty JSON string", RelayedAuthorisationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!RelayedAuthorisationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `RelayedAuthorisationData` properties.", entry.getKey())); + } + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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 (!RelayedAuthorisationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RelayedAuthorisationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RelayedAuthorisationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, RelayedAuthorisationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public RelayedAuthorisationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RelayedAuthorisationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RelayedAuthorisationData + * @throws IOException if the JSON string is invalid with respect to RelayedAuthorisationData + */ + public static RelayedAuthorisationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RelayedAuthorisationData.class); + } + + /** + * Convert an instance of RelayedAuthorisationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/Resource.java b/src/main/java/com/adyen/model/transferwebhooks/Resource.java new file mode 100644 index 000000000..2775d227c --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/Resource.java @@ -0,0 +1,277 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * Resource + */ + +public class Resource { + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private OffsetDateTime creationDate; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public Resource() { + } + + public Resource balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public Resource creationDate(OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.") + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public Resource id(String id) { + + this.id = id; + return this; + } + + /** + * The ID of the resource. + * @return id + **/ + @ApiModelProperty(value = "The ID of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Resource resource = (Resource) o; + return Objects.equals(this.balancePlatform, resource.balancePlatform) && + Objects.equals(this.creationDate, resource.creationDate) && + Objects.equals(this.id, resource.id); + } + + @Override + public int hashCode() { + return Objects.hash(balancePlatform, creationDate, id); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Resource {\n"); + sb.append(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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("balancePlatform"); + openapiFields.add("creationDate"); + openapiFields.add("id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(Resource.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Resource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Resource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Resource is not found in the empty JSON string", Resource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Resource.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `Resource` properties.", entry.getKey())); + } + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").toString())); + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Resource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Resource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Resource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Resource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Resource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Resource given an JSON string + * + * @param jsonString JSON string + * @return An instance of Resource + * @throws IOException if the JSON string is invalid with respect to Resource + */ + public static Resource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Resource.class); + } + + /** + * Convert an instance of Resource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java new file mode 100644 index 000000000..a0bbef749 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/ResourceReference.java @@ -0,0 +1,280 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(ResourceReference.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `ResourceReference` properties.", entry.getKey())); + } + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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/transferwebhooks/SELocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java new file mode 100644 index 000000000..4aeca1bbb --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/SELocalAccountIdentification.java @@ -0,0 +1,338 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SELocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SELocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/SGLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java new file mode 100644 index 000000000..07ad7c5ff --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/SGLocalAccountIdentification.java @@ -0,0 +1,337 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(SGLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `SGLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/TransactionEventViolation.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java new file mode 100644 index 000000000..6b566fbca --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionEventViolation.java @@ -0,0 +1,282 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.TransactionRuleReference; +import com.adyen.model.transferwebhooks.TransactionRuleSource; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransactionEventViolation + */ + +public class TransactionEventViolation { + public static final String SERIALIZED_NAME_REASON = "reason"; + @SerializedName(SERIALIZED_NAME_REASON) + private String reason; + + public static final String SERIALIZED_NAME_TRANSACTION_RULE = "transactionRule"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RULE) + private TransactionRuleReference transactionRule; + + public static final String SERIALIZED_NAME_TRANSACTION_RULE_SOURCE = "transactionRuleSource"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RULE_SOURCE) + private TransactionRuleSource transactionRuleSource; + + public TransactionEventViolation() { + } + + public TransactionEventViolation reason(String reason) { + + this.reason = reason; + return this; + } + + /** + * An explanation about why the transaction rule failed. + * @return reason + **/ + @ApiModelProperty(value = "An explanation about why the transaction rule failed.") + + public String getReason() { + return reason; + } + + + public void setReason(String reason) { + this.reason = reason; + } + + + public TransactionEventViolation transactionRule(TransactionRuleReference transactionRule) { + + this.transactionRule = transactionRule; + return this; + } + + /** + * Get transactionRule + * @return transactionRule + **/ + @ApiModelProperty(value = "") + + public TransactionRuleReference getTransactionRule() { + return transactionRule; + } + + + public void setTransactionRule(TransactionRuleReference transactionRule) { + this.transactionRule = transactionRule; + } + + + public TransactionEventViolation transactionRuleSource(TransactionRuleSource transactionRuleSource) { + + this.transactionRuleSource = transactionRuleSource; + return this; + } + + /** + * Get transactionRuleSource + * @return transactionRuleSource + **/ + @ApiModelProperty(value = "") + + public TransactionRuleSource getTransactionRuleSource() { + return transactionRuleSource; + } + + + public void setTransactionRuleSource(TransactionRuleSource transactionRuleSource) { + this.transactionRuleSource = transactionRuleSource; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionEventViolation transactionEventViolation = (TransactionEventViolation) o; + return Objects.equals(this.reason, transactionEventViolation.reason) && + Objects.equals(this.transactionRule, transactionEventViolation.transactionRule) && + Objects.equals(this.transactionRuleSource, transactionEventViolation.transactionRuleSource); + } + + @Override + public int hashCode() { + return Objects.hash(reason, transactionRule, transactionRuleSource); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionEventViolation {\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" transactionRule: ").append(toIndentedString(transactionRule)).append("\n"); + sb.append(" transactionRuleSource: ").append(toIndentedString(transactionRuleSource)).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("reason"); + openapiFields.add("transactionRule"); + openapiFields.add("transactionRuleSource"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionEventViolation.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactionEventViolation + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransactionEventViolation.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactionEventViolation is not found in the empty JSON string", TransactionEventViolation.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactionEventViolation.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionEventViolation` properties.", entry.getKey())); + } + } + // validate the optional field reason + if (jsonObj.get("reason") != null && !jsonObj.get("reason").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `reason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("reason").toString())); + } + // validate the optional field `transactionRule` + if (jsonObj.getAsJsonObject("transactionRule") != null) { + TransactionRuleReference.validateJsonObject(jsonObj.getAsJsonObject("transactionRule")); + } + // validate the optional field `transactionRuleSource` + if (jsonObj.getAsJsonObject("transactionRuleSource") != null) { + TransactionRuleSource.validateJsonObject(jsonObj.getAsJsonObject("transactionRuleSource")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionEventViolation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionEventViolation' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionEventViolation.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionEventViolation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionEventViolation read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionEventViolation given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionEventViolation + * @throws IOException if the JSON string is invalid with respect to TransactionEventViolation + */ + public static TransactionEventViolation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionEventViolation.class); + } + + /** + * Convert an instance of TransactionEventViolation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java new file mode 100644 index 000000000..7e4cb00fc --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleReference.java @@ -0,0 +1,280 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransactionRuleReference + */ + +public class TransactionRuleReference { + 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 TransactionRuleReference() { + } + + public TransactionRuleReference 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 TransactionRuleReference 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 TransactionRuleReference 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; + } + TransactionRuleReference transactionRuleReference = (TransactionRuleReference) o; + return Objects.equals(this.description, transactionRuleReference.description) && + Objects.equals(this.id, transactionRuleReference.id) && + Objects.equals(this.reference, transactionRuleReference.reference); + } + + @Override + public int hashCode() { + return Objects.hash(description, id, reference); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionRuleReference {\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(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleReference.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactionRuleReference + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransactionRuleReference.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactionRuleReference is not found in the empty JSON string", TransactionRuleReference.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactionRuleReference.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleReference` properties.", entry.getKey())); + } + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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 (!TransactionRuleReference.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionRuleReference' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionRuleReference.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionRuleReference value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionRuleReference read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionRuleReference given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionRuleReference + * @throws IOException if the JSON string is invalid with respect to TransactionRuleReference + */ + public static TransactionRuleReference fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionRuleReference.class); + } + + /** + * Convert an instance of TransactionRuleReference to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java new file mode 100644 index 000000000..8ce382be9 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRuleSource.java @@ -0,0 +1,247 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransactionRuleSource + */ + +public class TransactionRuleSource { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public TransactionRuleSource() { + } + + public TransactionRuleSource id(String id) { + + this.id = id; + return this; + } + + /** + * ID of the resource, when applicable. + * @return id + **/ + @ApiModelProperty(value = "ID of the resource, when applicable.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public TransactionRuleSource type(String type) { + + this.type = type; + return this; + } + + /** + * Indicates the type of resource for which the transaction rule is defined. Possible values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule imposed by Adyen. + * @return type + **/ + @ApiModelProperty(value = "Indicates the type of resource for which the transaction rule is defined. Possible values: * **PaymentInstrumentGroup** * **PaymentInstrument** * **BalancePlatform** * **EntityUsageConfiguration** * **PlatformRule**: The transaction rule is a platform-wide rule imposed by Adyen.") + + 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; + } + TransactionRuleSource transactionRuleSource = (TransactionRuleSource) o; + return Objects.equals(this.id, transactionRuleSource.id) && + Objects.equals(this.type, transactionRuleSource.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionRuleSource {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRuleSource.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactionRuleSource + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransactionRuleSource.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactionRuleSource is not found in the empty JSON string", TransactionRuleSource.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactionRuleSource.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRuleSource` properties.", entry.getKey())); + } + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field type + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionRuleSource.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionRuleSource' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionRuleSource.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionRuleSource value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionRuleSource read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionRuleSource given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionRuleSource + * @throws IOException if the JSON string is invalid with respect to TransactionRuleSource + */ + public static TransactionRuleSource fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionRuleSource.class); + } + + /** + * Convert an instance of TransactionRuleSource to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java new file mode 100644 index 000000000..4f5173aad --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransactionRulesResult.java @@ -0,0 +1,324 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.TransactionEventViolation; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransactionRulesResult + */ + +public class TransactionRulesResult { + public static final String SERIALIZED_NAME_ADVICE = "advice"; + @SerializedName(SERIALIZED_NAME_ADVICE) + private String advice; + + public static final String SERIALIZED_NAME_ALL_RULES_PASSED = "allRulesPassed"; + @SerializedName(SERIALIZED_NAME_ALL_RULES_PASSED) + private Boolean allRulesPassed; + + public static final String SERIALIZED_NAME_FAILED_TRANSACTION_RULES = "failedTransactionRules"; + @SerializedName(SERIALIZED_NAME_FAILED_TRANSACTION_RULES) + private List failedTransactionRules = null; + + public static final String SERIALIZED_NAME_SCORE = "score"; + @SerializedName(SERIALIZED_NAME_SCORE) + private Integer score; + + public TransactionRulesResult() { + } + + public TransactionRulesResult advice(String advice) { + + this.advice = advice; + return this; + } + + /** + * The advice given by the Risk analysis. + * @return advice + **/ + @ApiModelProperty(value = "The advice given by the Risk analysis.") + + public String getAdvice() { + return advice; + } + + + public void setAdvice(String advice) { + this.advice = advice; + } + + + public TransactionRulesResult allRulesPassed(Boolean allRulesPassed) { + + this.allRulesPassed = allRulesPassed; + return this; + } + + /** + * Indicates whether the transaction passed the evaluation for all transaction rules. + * @return allRulesPassed + **/ + @ApiModelProperty(value = "Indicates whether the transaction passed the evaluation for all transaction rules.") + + public Boolean getAllRulesPassed() { + return allRulesPassed; + } + + + public void setAllRulesPassed(Boolean allRulesPassed) { + this.allRulesPassed = allRulesPassed; + } + + + public TransactionRulesResult failedTransactionRules(List failedTransactionRules) { + + this.failedTransactionRules = failedTransactionRules; + return this; + } + + public TransactionRulesResult addFailedTransactionRulesItem(TransactionEventViolation failedTransactionRulesItem) { + if (this.failedTransactionRules == null) { + this.failedTransactionRules = new ArrayList<>(); + } + this.failedTransactionRules.add(failedTransactionRulesItem); + return this; + } + + /** + * Array containing all the transaction rules that the transaction violated. This list is only sent when `allRulesPassed` is **false**. + * @return failedTransactionRules + **/ + @ApiModelProperty(value = "Array containing all the transaction rules that the transaction violated. This list is only sent when `allRulesPassed` is **false**.") + + public List getFailedTransactionRules() { + return failedTransactionRules; + } + + + public void setFailedTransactionRules(List failedTransactionRules) { + this.failedTransactionRules = failedTransactionRules; + } + + + public TransactionRulesResult score(Integer score) { + + this.score = score; + return this; + } + + /** + * The score of the Risk analysis. + * @return score + **/ + @ApiModelProperty(value = "The score of the Risk analysis.") + + public Integer getScore() { + return score; + } + + + public void setScore(Integer score) { + this.score = score; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionRulesResult transactionRulesResult = (TransactionRulesResult) o; + return Objects.equals(this.advice, transactionRulesResult.advice) && + Objects.equals(this.allRulesPassed, transactionRulesResult.allRulesPassed) && + Objects.equals(this.failedTransactionRules, transactionRulesResult.failedTransactionRules) && + Objects.equals(this.score, transactionRulesResult.score); + } + + @Override + public int hashCode() { + return Objects.hash(advice, allRulesPassed, failedTransactionRules, score); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransactionRulesResult {\n"); + sb.append(" advice: ").append(toIndentedString(advice)).append("\n"); + sb.append(" allRulesPassed: ").append(toIndentedString(allRulesPassed)).append("\n"); + sb.append(" failedTransactionRules: ").append(toIndentedString(failedTransactionRules)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).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("advice"); + openapiFields.add("allRulesPassed"); + openapiFields.add("failedTransactionRules"); + openapiFields.add("score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransactionRulesResult.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransactionRulesResult + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransactionRulesResult.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransactionRulesResult is not found in the empty JSON string", TransactionRulesResult.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransactionRulesResult.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransactionRulesResult` properties.", entry.getKey())); + } + } + // validate the optional field advice + if (jsonObj.get("advice") != null && !jsonObj.get("advice").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `advice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("advice").toString())); + } + JsonArray jsonArrayfailedTransactionRules = jsonObj.getAsJsonArray("failedTransactionRules"); + if (jsonArrayfailedTransactionRules != null) { + // ensure the json data is an array + if (!jsonObj.get("failedTransactionRules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `failedTransactionRules` to be an array in the JSON string but got `%s`", jsonObj.get("failedTransactionRules").toString())); + } + + // validate the optional field `failedTransactionRules` (array) + for (int i = 0; i < jsonArrayfailedTransactionRules.size(); i++) { + TransactionEventViolation.validateJsonObject(jsonArrayfailedTransactionRules.get(i).getAsJsonObject()); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransactionRulesResult.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransactionRulesResult' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransactionRulesResult.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransactionRulesResult value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransactionRulesResult read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransactionRulesResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransactionRulesResult + * @throws IOException if the JSON string is invalid with respect to TransactionRulesResult + */ + public static TransactionRulesResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransactionRulesResult.class); + } + + /** + * Convert an instance of TransactionRulesResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java new file mode 100644 index 000000000..72f8ab4fd --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferEvent.java @@ -0,0 +1,922 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.Amount; +import com.adyen.model.transferwebhooks.AmountAdjustment; +import com.adyen.model.transferwebhooks.BalanceMutation; +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransferEvent + */ + +public class TransferEvent { + public static final String SERIALIZED_NAME_AMOUNT = "amount"; + @SerializedName(SERIALIZED_NAME_AMOUNT) + private Amount amount; + + public static final String SERIALIZED_NAME_AMOUNT_ADJUSTMENTS = "amountAdjustments"; + @SerializedName(SERIALIZED_NAME_AMOUNT_ADJUSTMENTS) + private List amountAdjustments = null; + + public static final String SERIALIZED_NAME_BOOKING_DATE = "bookingDate"; + @SerializedName(SERIALIZED_NAME_BOOKING_DATE) + private OffsetDateTime bookingDate; + + public static final String SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; + @SerializedName(SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME) + private OffsetDateTime estimatedArrivalTime; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_MUTATIONS = "mutations"; + @SerializedName(SERIALIZED_NAME_MUTATIONS) + private List mutations = null; + + public static final String SERIALIZED_NAME_ORIGINAL_AMOUNT = "originalAmount"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_AMOUNT) + private Amount originalAmount; + + /** + * The reason for the transfer status. + */ + @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; + + /** + * The status of the transfer event. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + APPROVALPENDING("approvalPending"), + + ATMWITHDRAWAL("atmWithdrawal"), + + ATMWITHDRAWALREVERSALPENDING("atmWithdrawalReversalPending"), + + ATMWITHDRAWALREVERSED("atmWithdrawalReversed"), + + AUTHADJUSTMENTAUTHORISED("authAdjustmentAuthorised"), + + AUTHADJUSTMENTERROR("authAdjustmentError"), + + AUTHADJUSTMENTREFUSED("authAdjustmentRefused"), + + AUTHORISED("authorised"), + + BANKTRANSFER("bankTransfer"), + + BANKTRANSFERPENDING("bankTransferPending"), + + BOOKED("booked"), + + BOOKINGPENDING("bookingPending"), + + CANCELLED("cancelled"), + + CAPTUREPENDING("capturePending"), + + CAPTUREREVERSALPENDING("captureReversalPending"), + + CAPTUREREVERSED("captureReversed"), + + CAPTURED("captured"), + + CHARGEBACK("chargeback"), + + CHARGEBACKPENDING("chargebackPending"), + + CHARGEBACKREVERSALPENDING("chargebackReversalPending"), + + CHARGEBACKREVERSED("chargebackReversed"), + + CREDITED("credited"), + + DEPOSITCORRECTION("depositCorrection"), + + DEPOSITCORRECTIONPENDING("depositCorrectionPending"), + + DISPUTE("dispute"), + + DISPUTECLOSED("disputeClosed"), + + DISPUTEEXPIRED("disputeExpired"), + + DISPUTENEEDSREVIEW("disputeNeedsReview"), + + ERROR("error"), + + EXPIRED("expired"), + + FAILED("failed"), + + FEE("fee"), + + FEEPENDING("feePending"), + + INTERNALTRANSFER("internalTransfer"), + + INTERNALTRANSFERPENDING("internalTransferPending"), + + INVOICEDEDUCTION("invoiceDeduction"), + + INVOICEDEDUCTIONPENDING("invoiceDeductionPending"), + + MANUALCORRECTIONPENDING("manualCorrectionPending"), + + MANUALLYCORRECTED("manuallyCorrected"), + + MATCHEDSTATEMENT("matchedStatement"), + + MATCHEDSTATEMENTPENDING("matchedStatementPending"), + + MERCHANTPAYIN("merchantPayin"), + + MERCHANTPAYINPENDING("merchantPayinPending"), + + MERCHANTPAYINREVERSED("merchantPayinReversed"), + + MERCHANTPAYINREVERSEDPENDING("merchantPayinReversedPending"), + + MISCCOST("miscCost"), + + MISCCOSTPENDING("miscCostPending"), + + PAYMENTCOST("paymentCost"), + + PAYMENTCOSTPENDING("paymentCostPending"), + + RECEIVED("received"), + + REFUNDPENDING("refundPending"), + + REFUNDREVERSALPENDING("refundReversalPending"), + + REFUNDREVERSED("refundReversed"), + + REFUNDED("refunded"), + + REFUSED("refused"), + + RESERVEADJUSTMENT("reserveAdjustment"), + + RESERVEADJUSTMENTPENDING("reserveAdjustmentPending"), + + RETURNED("returned"), + + SECONDCHARGEBACK("secondChargeback"), + + SECONDCHARGEBACKPENDING("secondChargebackPending"), + + UNDEFINED("undefined"); + + 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_TRANSACTION_ID = "transactionId"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + /** + * The type of the transfer event. Possible values: **accounting**, **tracking**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ACCOUNTING("accounting"), + + TRACKING("tracking"); + + 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 static final String SERIALIZED_NAME_UPDATE_DATE = "updateDate"; + @SerializedName(SERIALIZED_NAME_UPDATE_DATE) + private OffsetDateTime updateDate; + + public static final String SERIALIZED_NAME_VALUE_DATE = "valueDate"; + @SerializedName(SERIALIZED_NAME_VALUE_DATE) + private OffsetDateTime valueDate; + + public TransferEvent() { + } + + public TransferEvent 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 TransferEvent amountAdjustments(List amountAdjustments) { + + this.amountAdjustments = amountAdjustments; + return this; + } + + public TransferEvent addAmountAdjustmentsItem(AmountAdjustment amountAdjustmentsItem) { + if (this.amountAdjustments == null) { + this.amountAdjustments = new ArrayList<>(); + } + this.amountAdjustments.add(amountAdjustmentsItem); + return this; + } + + /** + * The amount adjustments in this transfer. + * @return amountAdjustments + **/ + @ApiModelProperty(value = "The amount adjustments in this transfer.") + + public List getAmountAdjustments() { + return amountAdjustments; + } + + + public void setAmountAdjustments(List amountAdjustments) { + this.amountAdjustments = amountAdjustments; + } + + + public TransferEvent bookingDate(OffsetDateTime bookingDate) { + + this.bookingDate = bookingDate; + return this; + } + + /** + * The date when the transfer request was sent. + * @return bookingDate + **/ + @ApiModelProperty(value = "The date when the transfer request was sent.") + + public OffsetDateTime getBookingDate() { + return bookingDate; + } + + + public void setBookingDate(OffsetDateTime bookingDate) { + this.bookingDate = bookingDate; + } + + + public TransferEvent estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { + + this.estimatedArrivalTime = estimatedArrivalTime; + return this; + } + + /** + * The estimated time the beneficiary should have access to the funds. + * @return estimatedArrivalTime + **/ + @ApiModelProperty(value = "The estimated time the beneficiary should have access to the funds.") + + public OffsetDateTime getEstimatedArrivalTime() { + return estimatedArrivalTime; + } + + + public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { + this.estimatedArrivalTime = estimatedArrivalTime; + } + + + public TransferEvent id(String id) { + + this.id = id; + return this; + } + + /** + * The unique identifier of the transfer event. + * @return id + **/ + @ApiModelProperty(value = "The unique identifier of the transfer event.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + public TransferEvent mutations(List mutations) { + + this.mutations = mutations; + return this; + } + + public TransferEvent addMutationsItem(BalanceMutation mutationsItem) { + if (this.mutations == null) { + this.mutations = new ArrayList<>(); + } + this.mutations.add(mutationsItem); + return this; + } + + /** + * The list of the balance mutation per event. + * @return mutations + **/ + @ApiModelProperty(value = "The list of the balance mutation per event.") + + public List getMutations() { + return mutations; + } + + + public void setMutations(List mutations) { + this.mutations = mutations; + } + + + public TransferEvent originalAmount(Amount originalAmount) { + + this.originalAmount = originalAmount; + return this; + } + + /** + * Get originalAmount + * @return originalAmount + **/ + @ApiModelProperty(value = "") + + public Amount getOriginalAmount() { + return originalAmount; + } + + + public void setOriginalAmount(Amount originalAmount) { + this.originalAmount = originalAmount; + } + + + public TransferEvent reason(ReasonEnum reason) { + + this.reason = reason; + return this; + } + + /** + * The reason for the transfer status. + * @return reason + **/ + @ApiModelProperty(value = "The reason for the transfer status.") + + public ReasonEnum getReason() { + return reason; + } + + + public void setReason(ReasonEnum reason) { + this.reason = reason; + } + + + public TransferEvent status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The status of the transfer event. + * @return status + **/ + @ApiModelProperty(value = "The status of the transfer event.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public TransferEvent transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes. + * @return transactionId + **/ + @ApiModelProperty(value = "The id of the transaction that is related to this accounting event. Only sent for events of type **accounting** where the balance changes.") + + public String getTransactionId() { + return transactionId; + } + + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + public TransferEvent type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of the transfer event. Possible values: **accounting**, **tracking**. + * @return type + **/ + @ApiModelProperty(value = "The type of the transfer event. Possible values: **accounting**, **tracking**.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + public TransferEvent updateDate(OffsetDateTime updateDate) { + + this.updateDate = updateDate; + return this; + } + + /** + * The date when the tracking status was updated. + * @return updateDate + **/ + @ApiModelProperty(value = "The date when the tracking status was updated.") + + public OffsetDateTime getUpdateDate() { + return updateDate; + } + + + public void setUpdateDate(OffsetDateTime updateDate) { + this.updateDate = updateDate; + } + + + public TransferEvent valueDate(OffsetDateTime valueDate) { + + this.valueDate = valueDate; + return this; + } + + /** + * A future date, when the funds are expected to be deducted from or credited to the balance account. + * @return valueDate + **/ + @ApiModelProperty(value = "A future date, when the funds are expected to be deducted from or credited to the balance account.") + + public OffsetDateTime getValueDate() { + return valueDate; + } + + + public void setValueDate(OffsetDateTime valueDate) { + this.valueDate = valueDate; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferEvent transferEvent = (TransferEvent) o; + return Objects.equals(this.amount, transferEvent.amount) && + Objects.equals(this.amountAdjustments, transferEvent.amountAdjustments) && + Objects.equals(this.bookingDate, transferEvent.bookingDate) && + Objects.equals(this.estimatedArrivalTime, transferEvent.estimatedArrivalTime) && + Objects.equals(this.id, transferEvent.id) && + Objects.equals(this.mutations, transferEvent.mutations) && + Objects.equals(this.originalAmount, transferEvent.originalAmount) && + Objects.equals(this.reason, transferEvent.reason) && + Objects.equals(this.status, transferEvent.status) && + Objects.equals(this.transactionId, transferEvent.transactionId) && + Objects.equals(this.type, transferEvent.type) && + Objects.equals(this.updateDate, transferEvent.updateDate) && + Objects.equals(this.valueDate, transferEvent.valueDate); + } + + @Override + public int hashCode() { + return Objects.hash(amount, amountAdjustments, bookingDate, estimatedArrivalTime, id, mutations, originalAmount, reason, status, transactionId, type, updateDate, valueDate); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferEvent {\n"); + sb.append(" amount: ").append(toIndentedString(amount)).append("\n"); + sb.append(" amountAdjustments: ").append(toIndentedString(amountAdjustments)).append("\n"); + sb.append(" bookingDate: ").append(toIndentedString(bookingDate)).append("\n"); + sb.append(" estimatedArrivalTime: ").append(toIndentedString(estimatedArrivalTime)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" mutations: ").append(toIndentedString(mutations)).append("\n"); + sb.append(" originalAmount: ").append(toIndentedString(originalAmount)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" updateDate: ").append(toIndentedString(updateDate)).append("\n"); + sb.append(" valueDate: ").append(toIndentedString(valueDate)).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("amountAdjustments"); + openapiFields.add("bookingDate"); + openapiFields.add("estimatedArrivalTime"); + openapiFields.add("id"); + openapiFields.add("mutations"); + openapiFields.add("originalAmount"); + openapiFields.add("reason"); + openapiFields.add("status"); + openapiFields.add("transactionId"); + openapiFields.add("type"); + openapiFields.add("updateDate"); + openapiFields.add("valueDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferEvent.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferEvent + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransferEvent.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferEvent is not found in the empty JSON string", TransferEvent.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferEvent.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferEvent` properties.", entry.getKey())); + } + } + // validate the optional field `amount` + if (jsonObj.getAsJsonObject("amount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("amount")); + } + JsonArray jsonArrayamountAdjustments = jsonObj.getAsJsonArray("amountAdjustments"); + if (jsonArrayamountAdjustments != null) { + // ensure the json data is an array + if (!jsonObj.get("amountAdjustments").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `amountAdjustments` to be an array in the JSON string but got `%s`", jsonObj.get("amountAdjustments").toString())); + } + + // validate the optional field `amountAdjustments` (array) + for (int i = 0; i < jsonArrayamountAdjustments.size(); i++) { + AmountAdjustment.validateJsonObject(jsonArrayamountAdjustments.get(i).getAsJsonObject()); + } + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + JsonArray jsonArraymutations = jsonObj.getAsJsonArray("mutations"); + if (jsonArraymutations != null) { + // ensure the json data is an array + if (!jsonObj.get("mutations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `mutations` to be an array in the JSON string but got `%s`", jsonObj.get("mutations").toString())); + } + + // validate the optional field `mutations` (array) + for (int i = 0; i < jsonArraymutations.size(); i++) { + BalanceMutation.validateJsonObject(jsonArraymutations.get(i).getAsJsonObject()); + } + } + // validate the optional field `originalAmount` + if (jsonObj.getAsJsonObject("originalAmount") != null) { + Amount.validateJsonObject(jsonObj.getAsJsonObject("originalAmount")); + } + // 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()); + } + // 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 transactionId + if (jsonObj.get("transactionId") != null && !jsonObj.get("transactionId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").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 (!TransferEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferEvent' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferEvent.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferEvent read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferEvent + * @throws IOException if the JSON string is invalid with respect to TransferEvent + */ + public static TransferEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferEvent.class); + } + + /** + * Convert an instance of TransferEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationData.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationData.java new file mode 100644 index 000000000..239572bb3 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationData.java @@ -0,0 +1,2007 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.Amount; +import com.adyen.model.transferwebhooks.BalanceMutation; +import com.adyen.model.transferwebhooks.CounterpartyV3; +import com.adyen.model.transferwebhooks.PaymentInstrument; +import com.adyen.model.transferwebhooks.RelayedAuthorisationData; +import com.adyen.model.transferwebhooks.ResourceReference; +import com.adyen.model.transferwebhooks.TransactionRulesResult; +import com.adyen.model.transferwebhooks.TransferEvent; +import com.adyen.model.transferwebhooks.TransferNotificationTransferTracking; +import com.adyen.model.transferwebhooks.TransferNotificationValidationFact; +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransferNotificationData + */ + +public class TransferNotificationData { + 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"; + @Deprecated + @SerializedName(SERIALIZED_NAME_BALANCE_ACCOUNT_ID) + private String balanceAccountId; + + public static final String SERIALIZED_NAME_BALANCE_PLATFORM = "balancePlatform"; + @SerializedName(SERIALIZED_NAME_BALANCE_PLATFORM) + private String balancePlatform; + + public static final String SERIALIZED_NAME_BALANCES = "balances"; + @SerializedName(SERIALIZED_NAME_BALANCES) + private List balances = null; + + /** + * The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. + */ + @JsonAdapter(CategoryEnum.Adapter.class) + public enum CategoryEnum { + BANK("bank"), + + INTERNAL("internal"), + + ISSUEDCARD("issuedCard"), + + 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 CounterpartyV3 counterparty; + + public static final String SERIALIZED_NAME_CREATION_DATE = "creationDate"; + @SerializedName(SERIALIZED_NAME_CREATION_DATE) + private OffsetDateTime creationDate; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + /** + * The direction of the transfer. Possible values: **incoming**, **outgoing**. + */ + @JsonAdapter(DirectionEnum.Adapter.class) + public enum DirectionEnum { + INCOMING("incoming"), + + OUTGOING("outgoing"); + + private String value; + + DirectionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DirectionEnum fromValue(String value) { + for (DirectionEnum b : DirectionEnum.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 DirectionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DirectionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DirectionEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_DIRECTION = "direction"; + @SerializedName(SERIALIZED_NAME_DIRECTION) + private DirectionEnum direction; + + public static final String SERIALIZED_NAME_EVENTS = "events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + private List events = null; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private String id; + + public static final String SERIALIZED_NAME_MODIFICATION_MERCHANT_REFERENCE = "modificationMerchantReference"; + @Deprecated + @SerializedName(SERIALIZED_NAME_MODIFICATION_MERCHANT_REFERENCE) + private String modificationMerchantReference; + + public static final String SERIALIZED_NAME_MODIFICATION_PSP_REFERENCE = "modificationPspReference"; + @Deprecated + @SerializedName(SERIALIZED_NAME_MODIFICATION_PSP_REFERENCE) + private String modificationPspReference; + + /** + * Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. + */ + @JsonAdapter(PanEntryModeEnum.Adapter.class) + public enum PanEntryModeEnum { + CHIP("chip"), + + COF("cof"), + + CONTACTLESS("contactless"), + + ECOMMERCE("ecommerce"), + + MAGSTRIPE("magstripe"), + + MANUAL("manual"), + + TOKEN("token"); + + private String value; + + PanEntryModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PanEntryModeEnum fromValue(String value) { + for (PanEntryModeEnum b : PanEntryModeEnum.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 PanEntryModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PanEntryModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PanEntryModeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PAN_ENTRY_MODE = "panEntryMode"; + @Deprecated + @SerializedName(SERIALIZED_NAME_PAN_ENTRY_MODE) + private PanEntryModeEnum panEntryMode; + + 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"; + @Deprecated + @SerializedName(SERIALIZED_NAME_PAYMENT_INSTRUMENT_ID) + private String paymentInstrumentId; + + public static final String SERIALIZED_NAME_PAYMENT_MERCHANT_REFERENCE = "paymentMerchantReference"; + @Deprecated + @SerializedName(SERIALIZED_NAME_PAYMENT_MERCHANT_REFERENCE) + private String paymentMerchantReference; + + /** + * The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). + */ + @JsonAdapter(PriorityEnum.Adapter.class) + public enum PriorityEnum { + CROSSBORDER("crossBorder"), + + DIRECTDEBIT("directDebit"), + + FAST("fast"), + + INSTANT("instant"), + + INTERNAL("internal"), + + REGULAR("regular"), + + WIRE("wire"); + + private String value; + + PriorityEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PriorityEnum fromValue(String value) { + for (PriorityEnum b : PriorityEnum.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 PriorityEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PriorityEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PriorityEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PRIORITY = "priority"; + @SerializedName(SERIALIZED_NAME_PRIORITY) + private PriorityEnum priority; + + /** + * Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. + */ + @JsonAdapter(ProcessingTypeEnum.Adapter.class) + public enum ProcessingTypeEnum { + ATMWITHDRAW("atmWithdraw"), + + BALANCEINQUIRY("balanceInquiry"), + + ECOMMERCE("ecommerce"), + + MOTO("moto"), + + POS("pos"), + + PURCHASEWITHCASHBACK("purchaseWithCashback"), + + RECURRING("recurring"), + + TOKEN("token"); + + private String value; + + ProcessingTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ProcessingTypeEnum fromValue(String value) { + for (ProcessingTypeEnum b : ProcessingTypeEnum.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 ProcessingTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ProcessingTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ProcessingTypeEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_PROCESSING_TYPE = "processingType"; + @Deprecated + @SerializedName(SERIALIZED_NAME_PROCESSING_TYPE) + private ProcessingTypeEnum processingType; + + public static final String SERIALIZED_NAME_PSP_PAYMENT_REFERENCE = "pspPaymentReference"; + @Deprecated + @SerializedName(SERIALIZED_NAME_PSP_PAYMENT_REFERENCE) + private String pspPaymentReference; + + /** + * Additional information about the status of the transfer. + */ + @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_REFERENCE = "reference"; + @SerializedName(SERIALIZED_NAME_REFERENCE) + private String reference; + + public static final String SERIALIZED_NAME_REFERENCE_FOR_BENEFICIARY = "referenceForBeneficiary"; + @SerializedName(SERIALIZED_NAME_REFERENCE_FOR_BENEFICIARY) + private String referenceForBeneficiary; + + public static final String SERIALIZED_NAME_RELAYED_AUTHORISATION_DATA = "relayedAuthorisationData"; + @SerializedName(SERIALIZED_NAME_RELAYED_AUTHORISATION_DATA) + private RelayedAuthorisationData relayedAuthorisationData; + + public static final String SERIALIZED_NAME_SEQUENCE_NUMBER = "sequenceNumber"; + @SerializedName(SERIALIZED_NAME_SEQUENCE_NUMBER) + private Integer sequenceNumber; + + /** + * The result of the transfer. For example, **authorised**, **refused**, or **error**. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + APPROVALPENDING("approvalPending"), + + ATMWITHDRAWAL("atmWithdrawal"), + + ATMWITHDRAWALREVERSALPENDING("atmWithdrawalReversalPending"), + + ATMWITHDRAWALREVERSED("atmWithdrawalReversed"), + + AUTHADJUSTMENTAUTHORISED("authAdjustmentAuthorised"), + + AUTHADJUSTMENTERROR("authAdjustmentError"), + + AUTHADJUSTMENTREFUSED("authAdjustmentRefused"), + + AUTHORISED("authorised"), + + BANKTRANSFER("bankTransfer"), + + BANKTRANSFERPENDING("bankTransferPending"), + + BOOKED("booked"), + + BOOKINGPENDING("bookingPending"), + + CANCELLED("cancelled"), + + CAPTUREPENDING("capturePending"), + + CAPTUREREVERSALPENDING("captureReversalPending"), + + CAPTUREREVERSED("captureReversed"), + + CAPTURED("captured"), + + CHARGEBACK("chargeback"), + + CHARGEBACKPENDING("chargebackPending"), + + CHARGEBACKREVERSALPENDING("chargebackReversalPending"), + + CHARGEBACKREVERSED("chargebackReversed"), + + CREDITED("credited"), + + DEPOSITCORRECTION("depositCorrection"), + + DEPOSITCORRECTIONPENDING("depositCorrectionPending"), + + DISPUTE("dispute"), + + DISPUTECLOSED("disputeClosed"), + + DISPUTEEXPIRED("disputeExpired"), + + DISPUTENEEDSREVIEW("disputeNeedsReview"), + + ERROR("error"), + + EXPIRED("expired"), + + FAILED("failed"), + + FEE("fee"), + + FEEPENDING("feePending"), + + INTERNALTRANSFER("internalTransfer"), + + INTERNALTRANSFERPENDING("internalTransferPending"), + + INVOICEDEDUCTION("invoiceDeduction"), + + INVOICEDEDUCTIONPENDING("invoiceDeductionPending"), + + MANUALCORRECTIONPENDING("manualCorrectionPending"), + + MANUALLYCORRECTED("manuallyCorrected"), + + MATCHEDSTATEMENT("matchedStatement"), + + MATCHEDSTATEMENTPENDING("matchedStatementPending"), + + MERCHANTPAYIN("merchantPayin"), + + MERCHANTPAYINPENDING("merchantPayinPending"), + + MERCHANTPAYINREVERSED("merchantPayinReversed"), + + MERCHANTPAYINREVERSEDPENDING("merchantPayinReversedPending"), + + MISCCOST("miscCost"), + + MISCCOSTPENDING("miscCostPending"), + + PAYMENTCOST("paymentCost"), + + PAYMENTCOSTPENDING("paymentCostPending"), + + RECEIVED("received"), + + REFUNDPENDING("refundPending"), + + REFUNDREVERSALPENDING("refundReversalPending"), + + REFUNDREVERSED("refundReversed"), + + REFUNDED("refunded"), + + REFUSED("refused"), + + RESERVEADJUSTMENT("reserveAdjustment"), + + RESERVEADJUSTMENTPENDING("reserveAdjustmentPending"), + + RETURNED("returned"), + + SECONDCHARGEBACK("secondChargeback"), + + SECONDCHARGEBACKPENDING("secondChargebackPending"), + + UNDEFINED("undefined"); + + 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_TRACKING = "tracking"; + @SerializedName(SERIALIZED_NAME_TRACKING) + private TransferNotificationTransferTracking tracking; + + public static final String SERIALIZED_NAME_TRANSACTION_ID = "transactionId"; + @Deprecated + @SerializedName(SERIALIZED_NAME_TRANSACTION_ID) + private String transactionId; + + public static final String SERIALIZED_NAME_TRANSACTION_RULES_RESULT = "transactionRulesResult"; + @SerializedName(SERIALIZED_NAME_TRANSACTION_RULES_RESULT) + private TransactionRulesResult transactionRulesResult; + + /** + * The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + ATMWITHDRAWAL("atmWithdrawal"), + + ATMWITHDRAWALREVERSAL("atmWithdrawalReversal"), + + BALANCEADJUSTMENT("balanceAdjustment"), + + BALANCEROLLOVER("balanceRollover"), + + BANKTRANSFER("bankTransfer"), + + CAPTURE("capture"), + + CAPTUREREVERSAL("captureReversal"), + + CHARGEBACK("chargeback"), + + CHARGEBACKREVERSAL("chargebackReversal"), + + DEPOSITCORRECTION("depositCorrection"), + + FEE("fee"), + + GRANT("grant"), + + INSTALLMENT("installment"), + + INSTALLMENTREVERSAL("installmentReversal"), + + INTERNALTRANSFER("internalTransfer"), + + INVOICEDEDUCTION("invoiceDeduction"), + + LEFTOVER("leftover"), + + MANUALCORRECTION("manualCorrection"), + + MISCCOST("miscCost"), + + PAYMENT("payment"), + + PAYMENTCOST("paymentCost"), + + REFUND("refund"), + + REFUNDREVERSAL("refundReversal"), + + REPAYMENT("repayment"), + + RESERVEADJUSTMENT("reserveAdjustment"), + + SECONDCHARGEBACK("secondChargeback"); + + 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 static final String SERIALIZED_NAME_VALIDATION_FACTS = "validationFacts"; + @Deprecated + @SerializedName(SERIALIZED_NAME_VALIDATION_FACTS) + private List validationFacts = null; + + public TransferNotificationData() { + } + + public TransferNotificationData 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 TransferNotificationData 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 TransferNotificationData 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; + } + + + @Deprecated + public TransferNotificationData balanceAccountId(String balanceAccountId) { + + this.balanceAccountId = balanceAccountId; + return this; + } + + /** + * 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() { + return balanceAccountId; + } + + + @Deprecated + public void setBalanceAccountId(String balanceAccountId) { + this.balanceAccountId = balanceAccountId; + } + + + public TransferNotificationData balancePlatform(String balancePlatform) { + + this.balancePlatform = balancePlatform; + return this; + } + + /** + * The unique identifier of the balance platform. + * @return balancePlatform + **/ + @ApiModelProperty(value = "The unique identifier of the balance platform.") + + public String getBalancePlatform() { + return balancePlatform; + } + + + public void setBalancePlatform(String balancePlatform) { + this.balancePlatform = balancePlatform; + } + + + public TransferNotificationData balances(List balances) { + + this.balances = balances; + return this; + } + + public TransferNotificationData addBalancesItem(BalanceMutation balancesItem) { + if (this.balances == null) { + this.balances = new ArrayList<>(); + } + this.balances.add(balancesItem); + return this; + } + + /** + * The list of the latest balance statuses in the transfer. + * @return balances + **/ + @ApiModelProperty(value = "The list of the latest balance statuses in the transfer.") + + public List getBalances() { + return balances; + } + + + public void setBalances(List balances) { + this.balances = balances; + } + + + public TransferNotificationData category(CategoryEnum category) { + + this.category = category; + return this; + } + + /** + * The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users. + * @return category + **/ + @ApiModelProperty(required = true, value = "The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users.") + + public CategoryEnum getCategory() { + return category; + } + + + public void setCategory(CategoryEnum category) { + this.category = category; + } + + + public TransferNotificationData counterparty(CounterpartyV3 counterparty) { + + this.counterparty = counterparty; + return this; + } + + /** + * Get counterparty + * @return counterparty + **/ + @ApiModelProperty(value = "") + + public CounterpartyV3 getCounterparty() { + return counterparty; + } + + + public void setCounterparty(CounterpartyV3 counterparty) { + this.counterparty = counterparty; + } + + + public TransferNotificationData creationDate(OffsetDateTime creationDate) { + + this.creationDate = creationDate; + return this; + } + + /** + * The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**. + * @return creationDate + **/ + @ApiModelProperty(value = "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.") + + public OffsetDateTime getCreationDate() { + return creationDate; + } + + + public void setCreationDate(OffsetDateTime creationDate) { + this.creationDate = creationDate; + } + + + public TransferNotificationData description(String description) { + + this.description = description; + return this; + } + + /** + * 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 = "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; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public TransferNotificationData direction(DirectionEnum direction) { + + this.direction = direction; + return this; + } + + /** + * The direction of the transfer. Possible values: **incoming**, **outgoing**. + * @return direction + **/ + @ApiModelProperty(value = "The direction of the transfer. Possible values: **incoming**, **outgoing**.") + + public DirectionEnum getDirection() { + return direction; + } + + + public void setDirection(DirectionEnum direction) { + this.direction = direction; + } + + + public TransferNotificationData events(List events) { + + this.events = events; + return this; + } + + public TransferNotificationData addEventsItem(TransferEvent eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * The list of events leading up to the current status of the transfer. + * @return events + **/ + @ApiModelProperty(value = "The list of events leading up to the current status of the transfer.") + + public List getEvents() { + return events; + } + + + public void setEvents(List events) { + this.events = events; + } + + + public TransferNotificationData id(String id) { + + this.id = id; + return this; + } + + /** + * The ID of the resource. + * @return id + **/ + @ApiModelProperty(value = "The ID of the resource.") + + public String getId() { + return id; + } + + + public void setId(String id) { + this.id = id; + } + + + @Deprecated + public TransferNotificationData modificationMerchantReference(String modificationMerchantReference) { + + this.modificationMerchantReference = modificationMerchantReference; + return this; + } + + /** + * The capture's merchant reference included in the transfer. + * @return modificationMerchantReference + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "The capture's merchant reference included in the transfer.") + + public String getModificationMerchantReference() { + return modificationMerchantReference; + } + + + @Deprecated + public void setModificationMerchantReference(String modificationMerchantReference) { + this.modificationMerchantReference = modificationMerchantReference; + } + + + @Deprecated + public TransferNotificationData modificationPspReference(String modificationPspReference) { + + this.modificationPspReference = modificationPspReference; + return this; + } + + /** + * The capture reference included in the transfer. + * @return modificationPspReference + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "The capture reference included in the transfer.") + + public String getModificationPspReference() { + return modificationPspReference; + } + + + @Deprecated + public void setModificationPspReference(String modificationPspReference) { + this.modificationPspReference = modificationPspReference; + } + + + @Deprecated + public TransferNotificationData panEntryMode(PanEntryModeEnum panEntryMode) { + + this.panEntryMode = panEntryMode; + return this; + } + + /** + * Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**. + * @return panEntryMode + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "Indicates the method used for entering the PAN to initiate a transaction. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **ecommerce**, **token**.") + + public PanEntryModeEnum getPanEntryMode() { + return panEntryMode; + } + + + @Deprecated + public void setPanEntryMode(PanEntryModeEnum panEntryMode) { + this.panEntryMode = panEntryMode; + } + + + public TransferNotificationData 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; + } + + + @Deprecated + public TransferNotificationData paymentInstrumentId(String paymentInstrumentId) { + + this.paymentInstrumentId = paymentInstrumentId; + return this; + } + + /** + * 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 + **/ + @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; + } + + + @Deprecated + public void setPaymentInstrumentId(String paymentInstrumentId) { + this.paymentInstrumentId = paymentInstrumentId; + } + + + @Deprecated + public TransferNotificationData paymentMerchantReference(String paymentMerchantReference) { + + this.paymentMerchantReference = paymentMerchantReference; + return this; + } + + /** + * The payment's merchant reference included in the transfer. + * @return paymentMerchantReference + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "The payment's merchant reference included in the transfer.") + + public String getPaymentMerchantReference() { + return paymentMerchantReference; + } + + + @Deprecated + public void setPaymentMerchantReference(String paymentMerchantReference) { + this.paymentMerchantReference = paymentMerchantReference; + } + + + public TransferNotificationData priority(PriorityEnum priority) { + + this.priority = priority; + return this; + } + + /** + * The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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). + * @return priority + **/ + @ApiModelProperty(value = "The priority for the bank transfer. This sets the speed at which the transfer is sent and the fees that you have to pay. Required for transfers with `category` **bank**. 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).") + + public PriorityEnum getPriority() { + return priority; + } + + + public void setPriority(PriorityEnum priority) { + this.priority = priority; + } + + + @Deprecated + public TransferNotificationData processingType(ProcessingTypeEnum processingType) { + + this.processingType = processingType; + return this; + } + + /** + * Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments. + * @return processingType + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "Contains information about how the payment was processed. For example, **ecommerce** for online or **pos** for in-person payments.") + + public ProcessingTypeEnum getProcessingType() { + return processingType; + } + + + @Deprecated + public void setProcessingType(ProcessingTypeEnum processingType) { + this.processingType = processingType; + } + + + @Deprecated + public TransferNotificationData pspPaymentReference(String pspPaymentReference) { + + this.pspPaymentReference = pspPaymentReference; + return this; + } + + /** + * The payment reference included in the transfer. + * @return pspPaymentReference + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "The payment reference included in the transfer.") + + public String getPspPaymentReference() { + return pspPaymentReference; + } + + + @Deprecated + public void setPspPaymentReference(String pspPaymentReference) { + this.pspPaymentReference = pspPaymentReference; + } + + + public TransferNotificationData reason(ReasonEnum reason) { + + this.reason = reason; + return this; + } + + /** + * Additional information about the status of the transfer. + * @return reason + **/ + @ApiModelProperty(value = "Additional information about the status of the transfer.") + + public ReasonEnum getReason() { + return reason; + } + + + public void setReason(ReasonEnum reason) { + this.reason = reason; + } + + + public TransferNotificationData reference(String reference) { + + this.reference = reference; + return this; + } + + /** + * Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference. + * @return reference + **/ + @ApiModelProperty(value = "Your reference for the transfer, used internally within your platform. If you don't provide this in the request, Adyen generates a unique reference.") + + public String getReference() { + return reference; + } + + + public void setReference(String reference) { + this.reference = reference; + } + + + public TransferNotificationData referenceForBeneficiary(String referenceForBeneficiary) { + + this.referenceForBeneficiary = referenceForBeneficiary; + return this; + } + + /** + * A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others. + * @return referenceForBeneficiary + **/ + @ApiModelProperty(value = " A reference that is sent to the recipient. This reference is also sent in all webhooks related to the transfer, so you can use it to track statuses for both the source and recipient of funds. Supported characters: **a-z**, **A-Z**, **0-9**. The maximum length depends on the `category`. - **internal**: 80 characters - **bank**: 35 characters when transferring to an IBAN, 15 characters for others.") + + public String getReferenceForBeneficiary() { + return referenceForBeneficiary; + } + + + public void setReferenceForBeneficiary(String referenceForBeneficiary) { + this.referenceForBeneficiary = referenceForBeneficiary; + } + + + public TransferNotificationData relayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { + + this.relayedAuthorisationData = relayedAuthorisationData; + return this; + } + + /** + * Get relayedAuthorisationData + * @return relayedAuthorisationData + **/ + @ApiModelProperty(value = "") + + public RelayedAuthorisationData getRelayedAuthorisationData() { + return relayedAuthorisationData; + } + + + public void setRelayedAuthorisationData(RelayedAuthorisationData relayedAuthorisationData) { + this.relayedAuthorisationData = relayedAuthorisationData; + } + + + public TransferNotificationData sequenceNumber(Integer sequenceNumber) { + + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of the transfer notification. The numbers start from 1 and increase with each new notification for a specific transfer. It can help you restore the correct sequence of events even if they arrive out of order. + * @return sequenceNumber + **/ + @ApiModelProperty(value = "The sequence number of the transfer notification. The numbers start from 1 and increase with each new notification for a specific transfer. It can help you restore the correct sequence of events even if they arrive out of order.") + + public Integer getSequenceNumber() { + return sequenceNumber; + } + + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + + public TransferNotificationData status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The result of the transfer. For example, **authorised**, **refused**, or **error**. + * @return status + **/ + @ApiModelProperty(required = true, value = "The result of the transfer. For example, **authorised**, **refused**, or **error**.") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + public TransferNotificationData tracking(TransferNotificationTransferTracking tracking) { + + this.tracking = tracking; + return this; + } + + /** + * Get tracking + * @return tracking + **/ + @ApiModelProperty(value = "") + + public TransferNotificationTransferTracking getTracking() { + return tracking; + } + + + public void setTracking(TransferNotificationTransferTracking tracking) { + this.tracking = tracking; + } + + + @Deprecated + public TransferNotificationData transactionId(String transactionId) { + + this.transactionId = transactionId; + return this; + } + + /** + * The ID of the transaction that is created based on the transfer. + * @return transactionId + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "The ID of the transaction that is created based on the transfer.") + + public String getTransactionId() { + return transactionId; + } + + + @Deprecated + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + + public TransferNotificationData transactionRulesResult(TransactionRulesResult transactionRulesResult) { + + this.transactionRulesResult = transactionRulesResult; + return this; + } + + /** + * Get transactionRulesResult + * @return transactionRulesResult + **/ + @ApiModelProperty(value = "") + + public TransactionRulesResult getTransactionRulesResult() { + return transactionRulesResult; + } + + + public void setTransactionRulesResult(TransactionRulesResult transactionRulesResult) { + this.transactionRulesResult = transactionRulesResult; + } + + + public TransferNotificationData type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**. + * @return type + **/ + @ApiModelProperty(value = "The type of transfer or transaction. For example, **refund**, **payment**, **internalTransfer**, **bankTransfer**.") + + public TypeEnum getType() { + return type; + } + + + public void setType(TypeEnum type) { + this.type = type; + } + + + @Deprecated + public TransferNotificationData validationFacts(List validationFacts) { + + this.validationFacts = validationFacts; + return this; + } + + public TransferNotificationData addValidationFactsItem(TransferNotificationValidationFact validationFactsItem) { + if (this.validationFacts == null) { + this.validationFacts = new ArrayList<>(); + } + this.validationFacts.add(validationFactsItem); + return this; + } + + /** + * The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information. + * @return validationFacts + * @deprecated + **/ + @Deprecated + @ApiModelProperty(value = "The evaluation of the validation facts. See [validation checks](https://docs.adyen.com/issuing/validation-checks) for more information.") + + public List getValidationFacts() { + return validationFacts; + } + + + @Deprecated + public void setValidationFacts(List validationFacts) { + this.validationFacts = validationFacts; + } + + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransferNotificationData transferNotificationData = (TransferNotificationData) o; + return Objects.equals(this.accountHolder, transferNotificationData.accountHolder) && + Objects.equals(this.amount, transferNotificationData.amount) && + Objects.equals(this.balanceAccount, transferNotificationData.balanceAccount) && + Objects.equals(this.balanceAccountId, transferNotificationData.balanceAccountId) && + Objects.equals(this.balancePlatform, transferNotificationData.balancePlatform) && + Objects.equals(this.balances, transferNotificationData.balances) && + Objects.equals(this.category, transferNotificationData.category) && + Objects.equals(this.counterparty, transferNotificationData.counterparty) && + Objects.equals(this.creationDate, transferNotificationData.creationDate) && + Objects.equals(this.description, transferNotificationData.description) && + Objects.equals(this.direction, transferNotificationData.direction) && + Objects.equals(this.events, transferNotificationData.events) && + Objects.equals(this.id, transferNotificationData.id) && + Objects.equals(this.modificationMerchantReference, transferNotificationData.modificationMerchantReference) && + Objects.equals(this.modificationPspReference, transferNotificationData.modificationPspReference) && + Objects.equals(this.panEntryMode, transferNotificationData.panEntryMode) && + Objects.equals(this.paymentInstrument, transferNotificationData.paymentInstrument) && + Objects.equals(this.paymentInstrumentId, transferNotificationData.paymentInstrumentId) && + Objects.equals(this.paymentMerchantReference, transferNotificationData.paymentMerchantReference) && + Objects.equals(this.priority, transferNotificationData.priority) && + Objects.equals(this.processingType, transferNotificationData.processingType) && + Objects.equals(this.pspPaymentReference, transferNotificationData.pspPaymentReference) && + Objects.equals(this.reason, transferNotificationData.reason) && + Objects.equals(this.reference, transferNotificationData.reference) && + Objects.equals(this.referenceForBeneficiary, transferNotificationData.referenceForBeneficiary) && + Objects.equals(this.relayedAuthorisationData, transferNotificationData.relayedAuthorisationData) && + Objects.equals(this.sequenceNumber, transferNotificationData.sequenceNumber) && + Objects.equals(this.status, transferNotificationData.status) && + Objects.equals(this.tracking, transferNotificationData.tracking) && + Objects.equals(this.transactionId, transferNotificationData.transactionId) && + Objects.equals(this.transactionRulesResult, transferNotificationData.transactionRulesResult) && + Objects.equals(this.type, transferNotificationData.type) && + Objects.equals(this.validationFacts, transferNotificationData.validationFacts); + } + + @Override + public int hashCode() { + return Objects.hash(accountHolder, amount, balanceAccount, balanceAccountId, balancePlatform, balances, category, counterparty, creationDate, description, direction, events, id, modificationMerchantReference, modificationPspReference, panEntryMode, paymentInstrument, paymentInstrumentId, paymentMerchantReference, priority, processingType, pspPaymentReference, reason, reference, referenceForBeneficiary, relayedAuthorisationData, sequenceNumber, status, tracking, transactionId, transactionRulesResult, type, validationFacts); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferNotificationData {\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(" balancePlatform: ").append(toIndentedString(balancePlatform)).append("\n"); + sb.append(" balances: ").append(toIndentedString(balances)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" counterparty: ").append(toIndentedString(counterparty)).append("\n"); + sb.append(" creationDate: ").append(toIndentedString(creationDate)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" direction: ").append(toIndentedString(direction)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" modificationMerchantReference: ").append(toIndentedString(modificationMerchantReference)).append("\n"); + sb.append(" modificationPspReference: ").append(toIndentedString(modificationPspReference)).append("\n"); + sb.append(" panEntryMode: ").append(toIndentedString(panEntryMode)).append("\n"); + sb.append(" paymentInstrument: ").append(toIndentedString(paymentInstrument)).append("\n"); + sb.append(" paymentInstrumentId: ").append(toIndentedString(paymentInstrumentId)).append("\n"); + sb.append(" paymentMerchantReference: ").append(toIndentedString(paymentMerchantReference)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" processingType: ").append(toIndentedString(processingType)).append("\n"); + sb.append(" pspPaymentReference: ").append(toIndentedString(pspPaymentReference)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); + sb.append(" referenceForBeneficiary: ").append(toIndentedString(referenceForBeneficiary)).append("\n"); + sb.append(" relayedAuthorisationData: ").append(toIndentedString(relayedAuthorisationData)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" tracking: ").append(toIndentedString(tracking)).append("\n"); + sb.append(" transactionId: ").append(toIndentedString(transactionId)).append("\n"); + sb.append(" transactionRulesResult: ").append(toIndentedString(transactionRulesResult)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" validationFacts: ").append(toIndentedString(validationFacts)).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("accountHolder"); + openapiFields.add("amount"); + openapiFields.add("balanceAccount"); + openapiFields.add("balanceAccountId"); + openapiFields.add("balancePlatform"); + openapiFields.add("balances"); + openapiFields.add("category"); + openapiFields.add("counterparty"); + openapiFields.add("creationDate"); + openapiFields.add("description"); + openapiFields.add("direction"); + openapiFields.add("events"); + openapiFields.add("id"); + openapiFields.add("modificationMerchantReference"); + openapiFields.add("modificationPspReference"); + openapiFields.add("panEntryMode"); + openapiFields.add("paymentInstrument"); + openapiFields.add("paymentInstrumentId"); + openapiFields.add("paymentMerchantReference"); + openapiFields.add("priority"); + openapiFields.add("processingType"); + openapiFields.add("pspPaymentReference"); + openapiFields.add("reason"); + openapiFields.add("reference"); + openapiFields.add("referenceForBeneficiary"); + openapiFields.add("relayedAuthorisationData"); + openapiFields.add("sequenceNumber"); + openapiFields.add("status"); + openapiFields.add("tracking"); + openapiFields.add("transactionId"); + openapiFields.add("transactionRulesResult"); + openapiFields.add("type"); + openapiFields.add("validationFacts"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("amount"); + openapiRequiredFields.add("category"); + openapiRequiredFields.add("status"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferNotificationData.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferNotificationData + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransferNotificationData.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferNotificationData is not found in the empty JSON string", TransferNotificationData.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferNotificationData.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferNotificationData` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferNotificationData.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 `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()) { + log.log(Level.WARNING, String.format("Expected the field `balanceAccountId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balanceAccountId").toString())); + } + // validate the optional field balancePlatform + if (jsonObj.get("balancePlatform") != null && !jsonObj.get("balancePlatform").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `balancePlatform` to be a primitive type in the JSON string but got `%s`", jsonObj.get("balancePlatform").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++) { + BalanceMutation.validateJsonObject(jsonArraybalances.get(i).getAsJsonObject()); + } + } + // 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) { + CounterpartyV3.validateJsonObject(jsonObj.getAsJsonObject("counterparty")); + } + // validate the optional field description + if (jsonObj.get("description") != null && !jsonObj.get("description").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + // ensure the field direction can be parsed to an enum value + if (jsonObj.get("direction") != null) { + if(!jsonObj.get("direction").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `direction` to be a primitive type in the JSON string but got `%s`", jsonObj.get("direction").toString())); + } + DirectionEnum.fromValue(jsonObj.get("direction").getAsString()); + } + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `events` to be an array in the JSON string but got `%s`", jsonObj.get("events").toString())); + } + + // validate the optional field `events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + TransferEvent.validateJsonObject(jsonArrayevents.get(i).getAsJsonObject()); + } + } + // validate the optional field id + if (jsonObj.get("id") != null && !jsonObj.get("id").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString())); + } + // validate the optional field modificationMerchantReference + if (jsonObj.get("modificationMerchantReference") != null && !jsonObj.get("modificationMerchantReference").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `modificationMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("modificationMerchantReference").toString())); + } + // validate the optional field modificationPspReference + if (jsonObj.get("modificationPspReference") != null && !jsonObj.get("modificationPspReference").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `modificationPspReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("modificationPspReference").toString())); + } + // ensure the field panEntryMode can be parsed to an enum value + if (jsonObj.get("panEntryMode") != null) { + if(!jsonObj.get("panEntryMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `panEntryMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("panEntryMode").toString())); + } + PanEntryModeEnum.fromValue(jsonObj.get("panEntryMode").getAsString()); + } + // 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()) { + log.log(Level.WARNING, String.format("Expected the field `paymentInstrumentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentInstrumentId").toString())); + } + // validate the optional field paymentMerchantReference + if (jsonObj.get("paymentMerchantReference") != null && !jsonObj.get("paymentMerchantReference").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `paymentMerchantReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("paymentMerchantReference").toString())); + } + // ensure the field priority can be parsed to an enum value + if (jsonObj.get("priority") != null) { + if(!jsonObj.get("priority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `priority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("priority").toString())); + } + PriorityEnum.fromValue(jsonObj.get("priority").getAsString()); + } + // ensure the field processingType can be parsed to an enum value + if (jsonObj.get("processingType") != null) { + if(!jsonObj.get("processingType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `processingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("processingType").toString())); + } + ProcessingTypeEnum.fromValue(jsonObj.get("processingType").getAsString()); + } + // validate the optional field pspPaymentReference + if (jsonObj.get("pspPaymentReference") != null && !jsonObj.get("pspPaymentReference").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `pspPaymentReference` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pspPaymentReference").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 reference + if (jsonObj.get("reference") != null && !jsonObj.get("reference").isJsonPrimitive()) { + log.log(Level.WARNING, 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 referenceForBeneficiary + if (jsonObj.get("referenceForBeneficiary") != null && !jsonObj.get("referenceForBeneficiary").isJsonPrimitive()) { + log.log(Level.WARNING, 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 `relayedAuthorisationData` + if (jsonObj.getAsJsonObject("relayedAuthorisationData") != null) { + RelayedAuthorisationData.validateJsonObject(jsonObj.getAsJsonObject("relayedAuthorisationData")); + } + // 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 `tracking` + if (jsonObj.getAsJsonObject("tracking") != null) { + TransferNotificationTransferTracking.validateJsonObject(jsonObj.getAsJsonObject("tracking")); + } + // validate the optional field transactionId + if (jsonObj.get("transactionId") != null && !jsonObj.get("transactionId").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `transactionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("transactionId").toString())); + } + // validate the optional field `transactionRulesResult` + if (jsonObj.getAsJsonObject("transactionRulesResult") != null) { + TransactionRulesResult.validateJsonObject(jsonObj.getAsJsonObject("transactionRulesResult")); + } + // 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()); + } + JsonArray jsonArrayvalidationFacts = jsonObj.getAsJsonArray("validationFacts"); + if (jsonArrayvalidationFacts != null) { + // ensure the json data is an array + if (!jsonObj.get("validationFacts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `validationFacts` to be an array in the JSON string but got `%s`", jsonObj.get("validationFacts").toString())); + } + + // validate the optional field `validationFacts` (array) + for (int i = 0; i < jsonArrayvalidationFacts.size(); i++) { + TransferNotificationValidationFact.validateJsonObject(jsonArrayvalidationFacts.get(i).getAsJsonObject()); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferNotificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferNotificationData' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferNotificationData.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferNotificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferNotificationData read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferNotificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferNotificationData + * @throws IOException if the JSON string is invalid with respect to TransferNotificationData + */ + public static TransferNotificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferNotificationData.class); + } + + /** + * Convert an instance of TransferNotificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java new file mode 100644 index 000000000..beec5bf62 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationRequest.java @@ -0,0 +1,340 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.adyen.model.transferwebhooks.TransferNotificationData; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransferNotificationRequest + */ + +public class TransferNotificationRequest { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + private TransferNotificationData data; + + public static final String SERIALIZED_NAME_ENVIRONMENT = "environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + private String environment; + + /** + * The type of webhook. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + CREATED("balancePlatform.transfer.created"), + + UPDATED("balancePlatform.transfer.updated"); + + 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 TransferNotificationRequest() { + } + + public TransferNotificationRequest data(TransferNotificationData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @ApiModelProperty(required = true, value = "") + + public TransferNotificationData getData() { + return data; + } + + + public void setData(TransferNotificationData data) { + this.data = data; + } + + + public TransferNotificationRequest environment(String environment) { + + this.environment = environment; + return this; + } + + /** + * The environment from which the webhook originated. Possible values: **test**, **live**. + * @return environment + **/ + @ApiModelProperty(required = true, value = "The environment from which the webhook originated. Possible values: **test**, **live**.") + + public String getEnvironment() { + return environment; + } + + + public void setEnvironment(String environment) { + this.environment = environment; + } + + + public TransferNotificationRequest type(TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of webhook. + * @return type + **/ + @ApiModelProperty(value = "The type of webhook.") + + 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; + } + TransferNotificationRequest transferNotificationRequest = (TransferNotificationRequest) o; + return Objects.equals(this.data, transferNotificationRequest.data) && + Objects.equals(this.environment, transferNotificationRequest.environment) && + Objects.equals(this.type, transferNotificationRequest.type); + } + + @Override + public int hashCode() { + return Objects.hash(data, environment, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferNotificationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).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("data"); + openapiFields.add("environment"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("data"); + openapiRequiredFields.add("environment"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferNotificationRequest.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferNotificationRequest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransferNotificationRequest.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferNotificationRequest is not found in the empty JSON string", TransferNotificationRequest.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferNotificationRequest.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferNotificationRequest` properties.", entry.getKey())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TransferNotificationRequest.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 `data` + if (jsonObj.getAsJsonObject("data") != null) { + TransferNotificationData.validateJsonObject(jsonObj.getAsJsonObject("data")); + } + // validate the optional field environment + if (jsonObj.get("environment") != null && !jsonObj.get("environment").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("environment").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 (!TransferNotificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferNotificationRequest' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferNotificationRequest.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferNotificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferNotificationRequest read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferNotificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferNotificationRequest + * @throws IOException if the JSON string is invalid with respect to TransferNotificationRequest + */ + public static TransferNotificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferNotificationRequest.class); + } + + /** + * Convert an instance of TransferNotificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationTransferTracking.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationTransferTracking.java new file mode 100644 index 000000000..b231bc4b4 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationTransferTracking.java @@ -0,0 +1,292 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +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 java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransferNotificationTransferTracking + */ + +public class TransferNotificationTransferTracking { + public static final String SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME = "estimatedArrivalTime"; + @SerializedName(SERIALIZED_NAME_ESTIMATED_ARRIVAL_TIME) + private OffsetDateTime estimatedArrivalTime; + + /** + * The tracking status of the transfer. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + CREDITED("credited"); + + 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 TransferNotificationTransferTracking() { + } + + public TransferNotificationTransferTracking estimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { + + this.estimatedArrivalTime = estimatedArrivalTime; + return this; + } + + /** + * The estimated time the beneficiary should have access to the funds. + * @return estimatedArrivalTime + **/ + @ApiModelProperty(value = "The estimated time the beneficiary should have access to the funds.") + + public OffsetDateTime getEstimatedArrivalTime() { + return estimatedArrivalTime; + } + + + public void setEstimatedArrivalTime(OffsetDateTime estimatedArrivalTime) { + this.estimatedArrivalTime = estimatedArrivalTime; + } + + + public TransferNotificationTransferTracking status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * The tracking status of the transfer. + * @return status + **/ + @ApiModelProperty(value = "The tracking status of the transfer.") + + 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; + } + TransferNotificationTransferTracking transferNotificationTransferTracking = (TransferNotificationTransferTracking) o; + return Objects.equals(this.estimatedArrivalTime, transferNotificationTransferTracking.estimatedArrivalTime) && + Objects.equals(this.status, transferNotificationTransferTracking.status); + } + + @Override + public int hashCode() { + return Objects.hash(estimatedArrivalTime, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferNotificationTransferTracking {\n"); + sb.append(" estimatedArrivalTime: ").append(toIndentedString(estimatedArrivalTime)).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("estimatedArrivalTime"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferNotificationTransferTracking.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferNotificationTransferTracking + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransferNotificationTransferTracking.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferNotificationTransferTracking is not found in the empty JSON string", TransferNotificationTransferTracking.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferNotificationTransferTracking.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferNotificationTransferTracking` properties.", entry.getKey())); + } + } + // 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 (!TransferNotificationTransferTracking.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferNotificationTransferTracking' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferNotificationTransferTracking.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferNotificationTransferTracking value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferNotificationTransferTracking read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferNotificationTransferTracking given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferNotificationTransferTracking + * @throws IOException if the JSON string is invalid with respect to TransferNotificationTransferTracking + */ + public static TransferNotificationTransferTracking fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferNotificationTransferTracking.class); + } + + /** + * Convert an instance of TransferNotificationTransferTracking to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java new file mode 100644 index 000000000..5b61be625 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/TransferNotificationValidationFact.java @@ -0,0 +1,247 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.JSON; + +/** + * TransferNotificationValidationFact + */ + +public class TransferNotificationValidationFact { + public static final String SERIALIZED_NAME_RESULT = "result"; + @SerializedName(SERIALIZED_NAME_RESULT) + private String result; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + private String type; + + public TransferNotificationValidationFact() { + } + + public TransferNotificationValidationFact result(String result) { + + this.result = result; + return this; + } + + /** + * The evaluation result of the validation fact. + * @return result + **/ + @ApiModelProperty(value = "The evaluation result of the validation fact.") + + public String getResult() { + return result; + } + + + public void setResult(String result) { + this.result = result; + } + + + public TransferNotificationValidationFact type(String type) { + + this.type = type; + return this; + } + + /** + * The type of the validation fact. + * @return type + **/ + @ApiModelProperty(value = "The type of the validation fact.") + + 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; + } + TransferNotificationValidationFact transferNotificationValidationFact = (TransferNotificationValidationFact) o; + return Objects.equals(this.result, transferNotificationValidationFact.result) && + Objects.equals(this.type, transferNotificationValidationFact.type); + } + + @Override + public int hashCode() { + return Objects.hash(result, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TransferNotificationValidationFact {\n"); + sb.append(" result: ").append(toIndentedString(result)).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("result"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(TransferNotificationValidationFact.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TransferNotificationValidationFact + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TransferNotificationValidationFact.openapiRequiredFields.isEmpty()) { + return; + } else { // has required fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TransferNotificationValidationFact is not found in the empty JSON string", TransferNotificationValidationFact.openapiRequiredFields.toString())); + } + } + + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TransferNotificationValidationFact.openapiFields.contains(entry.getKey())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `TransferNotificationValidationFact` properties.", entry.getKey())); + } + } + // validate the optional field result + if (jsonObj.get("result") != null && !jsonObj.get("result").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `result` to be a primitive type in the JSON string but got `%s`", jsonObj.get("result").toString())); + } + // validate the optional field type + if (jsonObj.get("type") != null && !jsonObj.get("type").isJsonPrimitive()) { + log.log(Level.WARNING, String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!TransferNotificationValidationFact.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TransferNotificationValidationFact' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TransferNotificationValidationFact.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, TransferNotificationValidationFact value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public TransferNotificationValidationFact read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TransferNotificationValidationFact given an JSON string + * + * @param jsonString JSON string + * @return An instance of TransferNotificationValidationFact + * @throws IOException if the JSON string is invalid with respect to TransferNotificationValidationFact + */ + public static TransferNotificationValidationFact fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TransferNotificationValidationFact.class); + } + + /** + * Convert an instance of TransferNotificationValidationFact to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java new file mode 100644 index 000000000..51602ace0 --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/UKLocalAccountIdentification.java @@ -0,0 +1,338 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(UKLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `UKLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/transferwebhooks/USLocalAccountIdentification.java b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java new file mode 100644 index 000000000..8bbfd774e --- /dev/null +++ b/src/main/java/com/adyen/model/transferwebhooks/USLocalAccountIdentification.java @@ -0,0 +1,421 @@ +/* + * Transfer webhooks + * + * 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.transferwebhooks; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; + +import com.adyen.model.transferwebhooks.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"); + } + /** + * logger for Deserialization Errors + */ + private static final Logger log = Logger.getLogger(USLocalAccountIdentification.class.getName()); + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to 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())) { + log.log(Level.WARNING, String.format("The field `%s` in the JSON string is not defined in the `USLocalAccountIdentification` properties.", entry.getKey())); + } + } + + // 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()) { + log.log(Level.WARNING, 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()) { + log.log(Level.WARNING, 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/notification/BankingWebhookHandler.java b/src/main/java/com/adyen/notification/BankingWebhookHandler.java new file mode 100644 index 000000000..342fbabe6 --- /dev/null +++ b/src/main/java/com/adyen/notification/BankingWebhookHandler.java @@ -0,0 +1,104 @@ +package com.adyen.notification; + +import com.adyen.model.configurationwebhooks.AccountHolderNotificationRequest; +import com.adyen.model.configurationwebhooks.BalanceAccountNotificationRequest; +import com.adyen.model.configurationwebhooks.CardOrderNotificationRequest; +import com.adyen.model.configurationwebhooks.PaymentNotificationRequest; +import com.adyen.model.configurationwebhooks.SweepConfigurationNotificationRequest; +import com.adyen.model.reportwebhooks.ReportNotificationRequest; +import com.adyen.model.transferwebhooks.TransferNotificationRequest; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class BankingWebhookHandler { + private static final Gson GSON = new Gson(); + private final Gson bankingGson; + + public BankingWebhookHandler() { + + GsonBuilder gsonBuilder = new GsonBuilder(); + this.bankingGson = gsonBuilder.create(); + } + + public List handleBankingWebhooks(String json) { + + JsonObject jsonObject = JsonParser.parseString(json).getAsJsonObject(); + JsonElement jsonType = jsonObject.get("type"); + String type = jsonType.getAsString(); + + List objectList = new ArrayList(); + // Configuration Notification Webhooks + if (Arrays.asList(AccountHolderNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(AccountHolderNotificationRequest.class); + } + if (Arrays.asList(BalanceAccountNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(BalanceAccountNotificationRequest.class); + } + if (Arrays.asList(CardOrderNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(CardOrderNotificationRequest.class); + } + if (Arrays.asList(PaymentNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(PaymentNotificationRequest.class); + } + if (Arrays.asList(SweepConfigurationNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(SweepConfigurationNotificationRequest.class); + } + // Report Notification Webhooks + if (Arrays.asList(ReportNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(ReportNotificationRequest.class); + } + // Transfer Notification Webhooks + if (Arrays.asList(TransferNotificationRequest.TypeEnum.values()).toString().contains(type)) { + objectList.add(TransferNotificationRequest.class); + } + + // Check if the passed webhook is valid + if (objectList.size() != 1) { + throw new IllegalArgumentException("Passed webhook json not valid"); + } + return objectList; + } + + public AccountHolderNotificationRequest getAccountHolderNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } + + public BalanceAccountNotificationRequest getBalanceAccountNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } + + public CardOrderNotificationRequest getCardOrderNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } + + public PaymentNotificationRequest getPaymentNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } + + public SweepConfigurationNotificationRequest getSweepConfigurationNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } + + public ReportNotificationRequest getReportNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } + + public TransferNotificationRequest getTransferNotificationRequest(String json) { + List typeList = handleBankingWebhooks(json); + return bankingGson.fromJson(json, typeList.get(0)); + } +} diff --git a/src/main/java/com/adyen/util/HMACValidator.java b/src/main/java/com/adyen/util/HMACValidator.java index b6931f4af..23979495c 100644 --- a/src/main/java/com/adyen/util/HMACValidator.java +++ b/src/main/java/com/adyen/util/HMACValidator.java @@ -73,6 +73,14 @@ public String calculateHMAC(NotificationRequestItem notificationRequestItem, Str return calculateHMAC(getDataToSign(notificationRequestItem), key); } + // Calculate HMAC for BankingWebhooks (Generic webhooks) + public boolean validateHMAC(String hmacKey, String hmacSignature, String payload) throws SignatureException { + String calculatedSign = calculateHMAC(payload, hmacSignature); + final byte [] expectedSign = calculatedSign.getBytes(StandardCharsets.UTF_8); + final byte[] merchantSign = hmacKey.getBytes(StandardCharsets.UTF_8); + return MessageDigest.isEqual(expectedSign, merchantSign); + } + public boolean validateHMAC(NotificationRequestItem notificationRequestItem, String key) throws IllegalArgumentException, SignatureException { if (notificationRequestItem == null) { throw new IllegalArgumentException("Missing NotificationRequestItem."); diff --git a/src/test/java/com/adyen/WebhookTest.java b/src/test/java/com/adyen/WebhookTest.java index ee88820be..afd853242 100644 --- a/src/test/java/com/adyen/WebhookTest.java +++ b/src/test/java/com/adyen/WebhookTest.java @@ -20,6 +20,8 @@ */ package com.adyen; +import com.adyen.model.configurationwebhooks.AccountHolderNotificationRequest; +import com.adyen.model.configurationwebhooks.BalanceAccountNotificationRequest; import com.adyen.model.nexo.DeviceType; import com.adyen.model.nexo.DisplayOutput; import com.adyen.model.nexo.EventNotification; @@ -28,18 +30,20 @@ import com.adyen.model.notification.NotificationRequest; import com.adyen.model.notification.NotificationRequestItem; import com.adyen.model.terminal.TerminalAPIRequest; +import com.adyen.notification.BankingWebhookHandler; import com.adyen.notification.WebhookHandler; +import com.adyen.util.HMACValidator; import com.google.gson.JsonParser; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.junit.function.ThrowingRunnable; import java.io.IOException; +import java.security.SignatureException; import java.util.ArrayList; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.*; /** * Tests notification messages @@ -236,4 +240,28 @@ private NotificationRequest readNotificationRequestFromFile(String resourcePath) String json = getFileContents(resourcePath); return webhookHandler.handleNotificationJson(json); } + + @Test + public void testBankingWebhook() { + BankingWebhookHandler webhookHandler = new BankingWebhookHandler(); + AccountHolderNotificationRequest accountHolderNotificationRequest = webhookHandler.getAccountHolderNotificationRequest("{ \"data\": {\"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\"accountHolder\": {\"contactDetails\": {\"address\": {\"country\": \"NL\",\"houseNumberOrName\": \"274\",\"postalCode\": \"1020CD\",\"street\": \"Brannan Street\"},\"email\": \"s.hopper@example.com\",\"phone\": {\"number\": \"+315551231234\",\"type\": \"Mobile\"}},\"description\": \"S.Hopper - Staff 123\",\"id\": \"AH00000000000000000000001\",\"status\": \"Active\"}},\"environment\": \"test\",\"type\": \"balancePlatform.accountHolder.created\"}"); + Assert.assertEquals(accountHolderNotificationRequest.getData().getBalancePlatform(), "YOUR_BALANCE_PLATFORM"); + } + + @Test + public void testBankingWebhookClassCastExceptionCast() { + BankingWebhookHandler webhookHandler = new BankingWebhookHandler(); + assertThrows(ClassCastException.class, () -> webhookHandler.getBalanceAccountNotificationRequest("{ \"data\": {\"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\"accountHolder\": {\"contactDetails\": {\"address\": {\"country\": \"NL\",\"houseNumberOrName\": \"274\",\"postalCode\": \"1020CD\",\"street\": \"Brannan Street\"},\"email\": \"s.hopper@example.com\",\"phone\": {\"number\": \"+315551231234\",\"type\": \"Mobile\"}},\"description\": \"S.Hopper - Staff 123\",\"id\": \"AH00000000000000000000001\",\"status\": \"Active\"}},\"environment\": \"test\",\"type\": \"balancePlatform.accountHolder.created\"}")); + } + + @Test + public void testBankingWebhookHmacValidator() throws SignatureException { + String notification = "{\"data\":{\"balancePlatform\":\"Integration_tools_test\",\"accountId\":\"BA32272223222H5HVKTBK4MLB\",\"sweep\":{\"id\":\"SWPC42272223222H5HVKV6H8C64DP5\",\"schedule\":{\"type\":\"balance\"},\"status\":\"active\",\"targetAmount\":{\"currency\":\"EUR\",\"value\":0},\"triggerAmount\":{\"currency\":\"EUR\",\"value\":0},\"type\":\"pull\",\"counterparty\":{\"balanceAccountId\":\"BA3227C223222H5HVKT3H9WLC\"},\"currency\":\"EUR\"}},\"environment\":\"test\",\"type\":\"balancePlatform.balanceAccountSweep.updated\"}"; + String signKey = "D7DD5BA6146493707BF0BE7496F6404EC7A63616B7158EC927B9F54BB436765F"; + String hmacKey = "9Qz9S/0xpar1klkniKdshxpAhRKbiSAewPpWoxKefQA="; + HMACValidator hmacValidator = new HMACValidator(); + boolean response = hmacValidator.validateHMAC(hmacKey, signKey, notification); + Assert.assertTrue(response); + } + } From aab24c5bf043951e146f61d47a9a40ddf7aede5f Mon Sep 17 00:00:00 2001 From: jillingk <93914435+jillingk@users.noreply.github.com> Date: Thu, 8 Jun 2023 14:31:58 +0200 Subject: [PATCH 15/15] [ITT-572] Process webhooks with Optional field (#1051) * Process webhooks with Optional field * removed unused imports * Update README.md Co-authored-by: Michael Paul * Update src/test/java/com/adyen/WebhookTest.java Co-authored-by: Michael Paul --------- Co-authored-by: Michael Paul --- README.md | 12 ++- .../notification/BankingWebhookHandler.java | 92 +++++-------------- src/test/java/com/adyen/WebhookTest.java | 15 ++- 3 files changed, 45 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 8904103d9..dddd7ab8b 100644 --- a/README.md +++ b/README.md @@ -176,8 +176,16 @@ boolean authenticity = hmacValidator.validateHMAC(hmacKey, signKey, payload); ~~~~ If this bool returns true, one can proceed to deserialize against the desired webhook type: ~~~~ java -BankingWebhookHandler webhookHandler = new BankingWebhookHandler(); -AccountHolderNotificationRequest accountHolderNotificationRequest = webhookHandler.getAccountHolderNotificationRequest(payload); +BankingWebhookHandler webhookHandler = new BankingWebhookHandler(payload); +// onAccountHolderNotificationRequest +webhookHandler.getAccountHolderNotificationRequest().ifPresent((AccountHolderNotificationRequest event) -> { + System.out.println(event.getData().getBalancePlatform()); +}); +// onBalanceAccountNotificationRequest +webhookHandler.getBalanceAccountNotificationRequest().ifPresent((BalanceAccountNotificationRequest event) -> { + System.out.println(event.getData().getBalanceAccount()); +}); + ~~~~ ### Proxy configuration You can configure a proxy connection by injecting your own AdyenHttpClient on your client instance. diff --git a/src/main/java/com/adyen/notification/BankingWebhookHandler.java b/src/main/java/com/adyen/notification/BankingWebhookHandler.java index 342fbabe6..7418c919e 100644 --- a/src/main/java/com/adyen/notification/BankingWebhookHandler.java +++ b/src/main/java/com/adyen/notification/BankingWebhookHandler.java @@ -9,96 +9,54 @@ import com.adyen.model.transferwebhooks.TransferNotificationRequest; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.Optional; public class BankingWebhookHandler { private static final Gson GSON = new Gson(); private final Gson bankingGson; + private String payload; - public BankingWebhookHandler() { + public BankingWebhookHandler(String payload) { GsonBuilder gsonBuilder = new GsonBuilder(); this.bankingGson = gsonBuilder.create(); + this.payload = payload; } - public List handleBankingWebhooks(String json) { - - JsonObject jsonObject = JsonParser.parseString(json).getAsJsonObject(); - JsonElement jsonType = jsonObject.get("type"); - String type = jsonType.getAsString(); - - List objectList = new ArrayList(); - // Configuration Notification Webhooks - if (Arrays.asList(AccountHolderNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(AccountHolderNotificationRequest.class); - } - if (Arrays.asList(BalanceAccountNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(BalanceAccountNotificationRequest.class); - } - if (Arrays.asList(CardOrderNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(CardOrderNotificationRequest.class); - } - if (Arrays.asList(PaymentNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(PaymentNotificationRequest.class); - } - if (Arrays.asList(SweepConfigurationNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(SweepConfigurationNotificationRequest.class); - } - // Report Notification Webhooks - if (Arrays.asList(ReportNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(ReportNotificationRequest.class); - } - // Transfer Notification Webhooks - if (Arrays.asList(TransferNotificationRequest.TypeEnum.values()).toString().contains(type)) { - objectList.add(TransferNotificationRequest.class); - } - - // Check if the passed webhook is valid - if (objectList.size() != 1) { - throw new IllegalArgumentException("Passed webhook json not valid"); - } - return objectList; + public Optional getAccountHolderNotificationRequest() { + return getOptionalField(AccountHolderNotificationRequest.class); } - public AccountHolderNotificationRequest getAccountHolderNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + public Optional getBalanceAccountNotificationRequest() { + return getOptionalField(BalanceAccountNotificationRequest.class); } - public BalanceAccountNotificationRequest getBalanceAccountNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + public Optional getCardOrderNotificationRequest() { + return getOptionalField(CardOrderNotificationRequest.class); } - public CardOrderNotificationRequest getCardOrderNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + public Optional getPaymentNotificationRequest() { + return getOptionalField(PaymentNotificationRequest.class); } - public PaymentNotificationRequest getPaymentNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + public Optional getSweepConfigurationNotificationRequest() { + return getOptionalField(SweepConfigurationNotificationRequest.class); } - public SweepConfigurationNotificationRequest getSweepConfigurationNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + public Optional getReportNotificationRequest() { + return getOptionalField(ReportNotificationRequest.class); } - public ReportNotificationRequest getReportNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + public Optional getTransferNotificationRequest() { + return getOptionalField(TransferNotificationRequest.class); } - public TransferNotificationRequest getTransferNotificationRequest(String json) { - List typeList = handleBankingWebhooks(json); - return bankingGson.fromJson(json, typeList.get(0)); + private Optional getOptionalField(Class clazz) { + try { + T val = bankingGson.fromJson(this.payload, clazz); + return Optional.ofNullable(val); + } catch (Exception e) { + return Optional.empty(); + } } } diff --git a/src/test/java/com/adyen/WebhookTest.java b/src/test/java/com/adyen/WebhookTest.java index afd853242..e74d5e58d 100644 --- a/src/test/java/com/adyen/WebhookTest.java +++ b/src/test/java/com/adyen/WebhookTest.java @@ -20,6 +20,7 @@ */ package com.adyen; +import com.adyen.model.balanceplatform.BankAccountIdentificationValidationRequest; import com.adyen.model.configurationwebhooks.AccountHolderNotificationRequest; import com.adyen.model.configurationwebhooks.BalanceAccountNotificationRequest; import com.adyen.model.nexo.DeviceType; @@ -243,15 +244,19 @@ private NotificationRequest readNotificationRequestFromFile(String resourcePath) @Test public void testBankingWebhook() { - BankingWebhookHandler webhookHandler = new BankingWebhookHandler(); - AccountHolderNotificationRequest accountHolderNotificationRequest = webhookHandler.getAccountHolderNotificationRequest("{ \"data\": {\"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\"accountHolder\": {\"contactDetails\": {\"address\": {\"country\": \"NL\",\"houseNumberOrName\": \"274\",\"postalCode\": \"1020CD\",\"street\": \"Brannan Street\"},\"email\": \"s.hopper@example.com\",\"phone\": {\"number\": \"+315551231234\",\"type\": \"Mobile\"}},\"description\": \"S.Hopper - Staff 123\",\"id\": \"AH00000000000000000000001\",\"status\": \"Active\"}},\"environment\": \"test\",\"type\": \"balancePlatform.accountHolder.created\"}"); - Assert.assertEquals(accountHolderNotificationRequest.getData().getBalancePlatform(), "YOUR_BALANCE_PLATFORM"); + String jsonRequest = "{ \"data\": {\"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\"accountHolder\": {\"contactDetails\": {\"address\": {\"country\": \"NL\",\"houseNumberOrName\": \"274\",\"postalCode\": \"1020CD\",\"street\": \"Brannan Street\"},\"email\": \"s.hopper@example.com\",\"phone\": {\"number\": \"+315551231234\",\"type\": \"Mobile\"}},\"description\": \"S.Hopper - Staff 123\",\"id\": \"AH00000000000000000000001\",\"status\": \"Active\"}},\"environment\": \"test\",\"type\": \"balancePlatform.accountHolder.created\"}"; + BankingWebhookHandler webhookHandler = new BankingWebhookHandler(jsonRequest); +AccountHolderNotificationRequest accountHolderNotificationRequest = webhookHandler.getAccountHolderNotificationRequest().get(); +Assert.assertEquals(accountHolderNotificationRequest.getData().getAccountHolder().getId(), "AH00000000000000000000001"); } @Test public void testBankingWebhookClassCastExceptionCast() { - BankingWebhookHandler webhookHandler = new BankingWebhookHandler(); - assertThrows(ClassCastException.class, () -> webhookHandler.getBalanceAccountNotificationRequest("{ \"data\": {\"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\"accountHolder\": {\"contactDetails\": {\"address\": {\"country\": \"NL\",\"houseNumberOrName\": \"274\",\"postalCode\": \"1020CD\",\"street\": \"Brannan Street\"},\"email\": \"s.hopper@example.com\",\"phone\": {\"number\": \"+315551231234\",\"type\": \"Mobile\"}},\"description\": \"S.Hopper - Staff 123\",\"id\": \"AH00000000000000000000001\",\"status\": \"Active\"}},\"environment\": \"test\",\"type\": \"balancePlatform.accountHolder.created\"}")); + String jsonRequest = "{ \"data\": {\"balancePlatform\": \"YOUR_BALANCE_PLATFORM\",\"accountHolder\": {\"contactDetails\": {\"address\": {\"country\": \"NL\",\"houseNumberOrName\": \"274\",\"postalCode\": \"1020CD\",\"street\": \"Brannan Street\"},\"email\": \"s.hopper@example.com\",\"phone\": {\"number\": \"+315551231234\",\"type\": \"Mobile\"}},\"description\": \"S.Hopper - Staff 123\",\"id\": \"AH00000000000000000000001\",\"status\": \"Active\"}},\"environment\": \"test\",\"type\": \"balancePlatform.accountHolder.created\"}"; + BankingWebhookHandler webhookHandler = new BankingWebhookHandler(jsonRequest); + Assert.assertTrue(webhookHandler.getAccountHolderNotificationRequest().isPresent()); + Assert.assertFalse(webhookHandler.getCardOrderNotificationRequest().isPresent()); + Assert.assertFalse(webhookHandler.getBalanceAccountNotificationRequest().isPresent()); } @Test